架构 arm64 的未定义符号

问题描述:

我每次从 CocoaPods 导入文件时都会收到 Apple Mach-O 链接器错误.

I am getting a Apple Mach-O Linker Error everytime I import a file from CocoaPods.

Undefined symbols for architecture arm64:
  "_OBJC_CLASS_$_FBSession", referenced from: someFile
ld: symbol(s) not found for architecture arm64

对于我使用的各种 Pod,我得到了大约 12 个.

I get about 12 of these, for the various Pods I use.

我正在尝试使用 XCode 5 为 iPhone 5S 构建.

I am trying to build for the iPhone 5S using XCode 5.

我已经在 SO 上尝试了各种解决方案,但还没有得到任何解决方案.

I've been trying various solutions here on SO, but haven't got any of them to work yet.

我该如何解决这个 Apple Mach-O 链接器错误?

刚刚发现另一个可能有趣的警告,我希望这能引导我找到解决方案:

Just found another warning that might be interesting, I hope this leads me to the solution:

Ignoring file ~/Library/Developer/Xcode/DerivedData/SomeApp/Build/Products/Debug-iphoneos/libPods.a, 

文件是为存档构建的,这不是被链接的架构 (arm64):~/Library/Developer/Xcode/DerivedData/someApp/Build/Products/Debug-iphoneos/libPods.a

如果你的ArchitecturesValid Architectures都没有问题,你可以检查你是否添加了$(inherited) ,将在 pod 中生成的链接器标志添加到其他链接器标志,如下所示:

If your Architectures and Valid Architectures are all right, you may check whether you have added $(inherited) , which will add linker flags generated in pods, to Other Linker Flags as below: