“Semantic error:Redefinition of'__ccContentScaleFactor'with a different type”在Cocos2D v2 [英] "Semantic error: Redefinition of '__ccContentScaleFactor' with a different type" in Cocos2D v2

查看:1035
本文介绍了“Semantic error:Redefinition of'__ccContentScaleFactor'with a different type”在Cocos2D v2的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开发了一个新游戏,它在我真正的ios设备,甚至模拟器上运行完美,但当我决定提交到AppStore它是给这个行上的错误。

i have developed a new game and it is running perfectly fine on my real ios devices and even on simulators but when i decided to submit it to AppStore it is giving error on this line.

extern CGFloat  __ccContentScaleFactor;

且错误是

cocos2d/Platforms/iOS/CCDirectorIOS.h:102:16: Redefinition of '__ccContentScaleFactor' with a different type: 'CGFloat' (aka 'double') vs 'float'

任何人都可以帮我解决这个问题我只是更新xcode到5.1。感谢

can anyone please help me with this issue i just update xcode to 5.1. thanks

推荐答案

重要更新:






Cocos2D v2 .2和64位修复已被释放。



我强烈建议每个cocos2d v2.x开发人员升级到此版本,而不是应用快速修复下面。有许多64位兼容性问题潜伏在cocos2d v2.0和v2.1,这可能会使他们丑陋的头,在奇怪的错误,视觉上的毛刺或更多的编译错误,取决于应用程序。

Important Update:


Cocos2D v2.2 with 64-Bit fixes has been released.

I strongly suggest every cocos2d v2.x developer to upgrade to this version rather than applying the quick fix below. There are many 64-Bit compatibility issues lurking in cocos2d v2.0 and v2.1, which may rear their ugly head in weird bugs, visual glitches or more compile errors - depending on the app.

从2015年2月开始,Apple只接受包含64位二进制文​​件的新应用和应用升级。因此,强烈建议您在64位设备上将代码和cocos2d设置为正常工作状态。

Beginning in February 2015 Apple will only accept new apps and app upgrades which include 64-Bit binaries. So it's highly recommended to get your code and cocos2d to a proper working state on 64-bit devices.

编辑编译器所抱怨的行,更改 CGFloat float ,使其显示为:

Edit the line the compiler complains about, change CGFloat to float so that it reads:

extern float  __ccContentScaleFactor;

但这表明xcode正在构建arm64切片。对于cocos2d-iphone v2.x,最好禁用/从支持的体系结构中删除arm64,因为 Cocos2D v2.1及更早版本与64位设备不完全兼容!

However this indicates that xcode is building the arm64 slice. For cocos2d-iphone v2.x it is best to disable/remove arm64 from supported architectures because Cocos2D v2.1 and earlier are not fully compatible with 64bit devices!

当运行一个编译为64位代码并运行在64位设备(iPhone 5S和更高版本)上的Cocos2D v2.1或更早版本的应用程序时,可能会有奇怪的错误和副作用。这些问题可能不会在iOS模拟器上发生。

There can be weird bugs and side-effects when running a Cocos2D v2.1 or earlier app compiled as 64-bit code and running on a 64-Bit device (iPhone 5S and newer). These issues may not occur on the iOS Simulator.

这篇关于“Semantic error:Redefinition of'__ccContentScaleFactor'with a different type”在Cocos2D v2的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆