【问题标题】:Xcode: build failed: error messageXcode:构建失败:错误消息
【发布时间】:2014-04-30 20:40:11
【问题描述】:

我正在构建并运行我的 Xcode 应用程序,但由于以下错误消息而收到构建失败消息:

Undefined symbols for architecture x86_64:
  "_OBJC_CLASS_$_SFAccountManager", referenced from:
      objc-class-ref in AppDelegate.o
  "_OBJC_CLASS_$_SFApplication", referenced from:
      objc-class-ref in main.o
  "_OBJC_CLASS_$_SFAuthenticationManager", referenced from:
      objc-class-ref in AppDelegate.o
  "_OBJC_CLASS_$_SFLogger", referenced from:
      objc-class-ref in AppDelegate.o
  "_OBJC_CLASS_$_SFRestAPI", referenced from:
      objc-class-ref in OrderVC.o
      objc-class-ref in PerformanceVC.o
      objc-class-ref in CustomerDetailsVC.o
      objc-class-ref in AppDelegate.o
  "_kSFLoginHostChangedNotification", referenced from:
      -[AppDelegate init] in AppDelegate.o
      -[AppDelegate dealloc] in AppDelegate.o
  "_kSFUserLogoutNotification", referenced from:
      -[AppDelegate init] in AppDelegate.o
      -[AppDelegate dealloc] in AppDelegate.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

如何解决这个/这些问题?

【问题讨论】:

    标签: ios xcode build compiler-errors


    【解决方案1】:

    我会在您的项目中将Architectures 设置为$(ARCHS_STANDARD_32_BIT),这对于iOS 构建和OS X/模拟器构建都是正确的。

    问题是您的库不是为 x86_64 构建的,但您的项目正在尝试为 i386 和 x86_64 构建,因此链接步骤失败。 Apple 将 Xcode 5.1 中的默认架构更改为包含 64 位架构。

    有关更多信息,请参阅这些其他问题:

    【讨论】:

    • 感谢您的洞察力和解决方案。第一次完美运行。
    【解决方案2】:

    在 xcode 中单击您的项目并转到构建设置 -> 有效架构并删除 arm64 并将 Standard Architectures 更改为 armv7 和 armv7s 。清理并重新运行项目

    【讨论】:

      【解决方案3】:

      您似乎需要在项目中包含 Salesforce Mobile SDK iOS 框架。

      【讨论】:

        猜你喜欢
        • 2013-01-15
        • 2018-07-27
        • 2016-06-15
        • 2021-03-04
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2012-11-26
        • 2015-11-05
        相关资源
        最近更新 更多