【问题标题】:Undefined symbols for architecture armv7 - using Xcode 6.0.1 and Cocos2d-x 3.2架构 armv7 的未定义符号 - 使用 Xcode 6.0.1 和 Cocos2d-x 3.2
【发布时间】:2015-09-14 00:24:14
【问题描述】:

当我选择“仅构建活动架构”=“是”时,我可以在我的设备中运行该项目。但是当我选择“否”时,它会显示同一个项目的 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

【问题讨论】:

    标签: ios xcode cocos2d-x


    【解决方案1】:

    仅在有效架构以及游戏和 cocos2d-x 项目的架构部分添加 armv7 和 armv7s。 (在项目和目标部分构建设置中)

    【讨论】:

      【解决方案2】:

      我已经通过在我的 Cocos2d-x 3.7 项目中使用以下设置解决了这个问题。

      • 在 Xcode 中选择您的顶级项目(在本例中为“ZooCubes”)
      • 将 iOS 部署目标设置为“iOS 7”
      • 将有效架构设置为:“arm64 arm7”
      • 还要确保架构设置为“标准架构 arm7、arm64”

      确保对 cocos2d_libs.xcodeproj 重复此过程

      有时,当类引用缺少的框架时,也会显示相同的错误消息。就我而言,我必须添加 GameKit 框架,因为我的一个类试图引用它。

      最后,我还遇到了一些情况(例如在 cocos2dx-2.2.6 中创建新项目),需要将所有目标的“仅构建活动架构”选项设置为“否”以修复“未定义”符号错误。

      【讨论】:

        猜你喜欢
        • 2012-08-29
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2016-04-29
        • 2011-09-19
        相关资源
        最近更新 更多