当我选择"Build Active Architecture Only“= "YES”时,我可以在我的设备上运行该项目。但当我选择"NO“时,它显示同一个项目有200多个错误。
我选择了标准架构(armv7,arm64)作为这个项目的架构,选择了arm64,armv7,armv7s作为这个项目的有效架构。
以下是我收到的错误的一部分:
ld: warning: ld: warning: ignoring file /Users/john/Library/Developer/Xcode/DerivedData/Hero-hbrtqluudvdwemgbwcyacbfeysqv/Build/Products/Debug-iphoneos/libbox2d iOS.a, file was built for archive which is not the architecture being linked (armv7): /Users/john/Library/Developer/Xcode/DerivedData/Hero-hbrtqluudvdwemgbwcyacbfeysqv/Build/Products/Debug-iphoneos/libbox2d iOS.aignoring file /Users/john/Library/Developer/Xcode/DerivedData/Hero-hbrtqluudvdwemgbwcyacbfeysqv/Build/Products/Debug-iphoneos/libchipmunk iOS.a, file was built for archive which is not the architecture being linked (armv7): /Users/john/Library/Developer/Xcode/DerivedData/Hero-hbrtqluudvdwemgbwcyacbfeysqv/Build/Products/Debug-iphoneos/libchipmunk iOS.a
ld: warning: ignoring file /Users/john/Library/Developer/Xcode/DerivedData/Hero-hbrtqluudvdwemgbwcyacbfeysqv/Build/Products/Debug-iphoneos/libcocos2dx-extensions iOS.a, file was built for archive which is not the architecture being linked (armv7): /Users/john/Library/Developer/Xcode/DerivedData/Hero-hbrtqluudvdwemgbwcyacbfeysqv/Build/Products/Debug-iphoneos/libcocos2dx-extensions iOS.a
ld: warning: ignoring file /Users/john/Library/Developer/Xcode/DerivedData/Hero-hbrtqluudvdwemgbwcyacbfeysqv/Build/Products/Debug-iphoneos/libCocosDenshion iOS.a, file was built for archive which is not the architecture being linked (armv7): /Users/john/Library/Developer/Xcode/DerivedData/Hero-hbrtqluudvdwemgbwcyacbfeysqv/Build/Products/Debug-iphoneos/libCocosDenshion iOS.a
ld: warning: ignoring file /Users/john/Library/Developer/Xcode/DerivedData/Hero-hbrtqluudvdwemgbwcyacbfeysqv/Build/Products/Debug-iphoneos/libcocos2dx iOS.a, file was built for archive which is not the architecture being linked (armv7): /Users/john/Library/Developer/Xcode/DerivedData/Hero-hbrtqluudvdwemgbwcyacbfeysqv/Build/Products/Debug-iphoneos/libcocos2dx iOS.a
Undefined symbols for architecture armv7:
"cocos2d::Touch::getLocation() const", referenced from:
Credits::onTouchBegan(cocos2d::Touch*, cocos2d::Event*) in Credits.o
Credits::onTouchMoved(cocos2d::Touch*, cocos2d::Event*) in Credits.o
"cocos2d::MoveTo::create(float, cocos2d::Vec2 const&)", referenced from:
Credits::resetCreditAction() in Credits.o
"cocos2d::CallFunc::create(std::__1::function<void ()> const&)", referenced from:
Credits::resetCreditAction() in Credits.o
"cocos2d::Application::setAnimationInterval(double)", referenced from:
vtable for AppDelegate in AppDelegate.o
"cocos2d::Director::runWithScene(cocos2d::Scene*)", referenced from:
AppDelegate::applicationDidFinishLaunching() in AppDelegate.o
"cocos2d::Application::~Application()", referenced from:
AppDelegate::~AppDelegate() in AppDelegate.o
"cocos2d::Application::Application()", referenced from:
AppDelegate::AppDelegate() in AppDelegate.o发布于 2014-10-14 17:40:11
仅在游戏和cocos2d-x项目的有效架构和架构部分添加armv7和armv7s。(在项目和目标剖面构建设置中)
发布于 2015-08-09 06:04:46
我已经通过在我的Cocos2d-x 3.7项目中使用以下设置修复了这个问题。
请确保对cocos2d_libs.xcodeproj重复此过程

有时,当一个类引用了一个缺失的框架时,同样的错误消息也会显示出来。在我的例子中,我必须添加GameKit框架,因为我的一个类正在尝试引用它。
最后,我还遇到了这样的情况(例如,在cocos2dx-2.2.6中创建一个新项目),所有目标的"Build Active Architecture Only“选项都需要设置为”No“,以便修复”Undefined symbols“错误。
https://stackoverflow.com/questions/26325096
复制相似问题