2014-10-12 71 views
0

當我選擇「Build Active Architecture Only」=「YES」時,我可以在我的設備中運行該項目。但是當我選擇「否」時,它顯示了同一個項目中超過200個錯誤。架構armv7的未定義符號 - 使用Xcode 6.0.1和Cocos2d-x 3.2

提供,我選擇標準體系結構(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 

回答

1

只有在有效的架構添加的ARMv7和armv7s以及遊戲和Cocos2d-X項目的建築部分。 (在項目和目標部分編譯設置中)

0

我已通過在我的Cocos2d-x 3.7項目中使用以下設置來解決此問題。

  • 選擇Xcode中的頂級項目(在這種情況下, 'ZooCubes')
  • 設置iOS的部署目標爲 「iOS的7」
  • 組有效的體系結構來: 「arm64 ARM7」
  • 還確保架構設置爲「標準架構ARM7,arm64」

確保重複此過程cocos2d_libs.xcodeproj

enter image description here

有時,當類引用缺少的框架時,也可能會顯示相同的錯誤消息。在我的情況下,我不得不添加GameKit框架,因爲我的一個類試圖引用它。

最後,我也遇到過的情況下(如創建於cocos2dx-2.2.6新項目),其中「構建有源體系僅」選項需要被設置爲「否」的所有目標,以解決「未定義符號的錯誤。

相關問題