【发布时间】:2014-07-25 22:50:24
【问题描述】:
您好,我正在按照本教程为我的 cocos2d 项目启用 ARC
http://www.learn-cocos2d.com/2012/04/enabling-arc-cocos2d-project-howto-stepbystep-tutorialguide/
基本思路是使用cocos2d作为静态库,禁用arc。它可以在模拟器上运行,但在我的 iPhone 5s 上崩溃
"_OBJC_CLASS_$_CCScaleTo", referenced from:
objc-class-ref in Helper.o
"_OBJC_CLASS_$_CCTexture2D", referenced from:
objc-class-ref in AppDelegate.o
"_ccGLBlendFunc", referenced from:
-[SlidingMenuGrid visit] in SlidingMenuGrid.o
"_OBJC_CLASS_$_CCLayer", referenced from:
_OBJC_CLASS_$_SlidingMenuGrid in SlidingMenuGrid.o
_OBJC_CLASS_$_GameScene in GameScene.o
_OBJC_CLASS_$_LevelScene in LevelScene.o
_OBJC_CLASS_$_Mask in Mask.o
_OBJC_CLASS_$_MainScene in MainScene.o
_OBJC_CLASS_$_ResultScene in ResultScene.o
_OBJC_CLASS_$_PackScene in PackScene.o
...
"_ccDrawPoints", referenced from:
-[SlidingMenuGrid visit] in SlidingMenuGrid.o
"_ccDrawPoint", referenced from:
-[SlidingMenuGrid visit] in SlidingMenuGrid.o
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
我将 armv7 和 armv7s 用于 cocos2d 库和游戏目标。
【问题讨论】:
-
这不是崩溃,而是链接器错误。可能与两个目标中不同的构建架构有关。顺便说一句,如果这是一个新项目,您可能应该使用 v3。
标签: objective-c xcode cocoa-touch cocos2d-iphone automatic-ref-counting