每次我从CocoaPods导入文件时,我都会得到一个Apple Mach-O链接器错误。

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

我有大约12个这样的耳机,用于我使用的各种pod。

我试图使用XCode 5为iPhone 5S构建。

我一直在尝试各种解决方案这里所以,但还没有得到任何工作。

我如何解决这个苹果Mach-O链接错误?


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

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

~/Library/Developer/Xcode/DerivedData/someApp/Build/Products/Debug-iphoneos/libPods.a


当前回答

在删除DerivedData- >Build- >Products- >Debug-iphoneos的内容后解决

其他回答

在某些情况下,如果您在.h文件中定义了另外一个接口,但没有实现所有这些接口,则会发生此错误。

链接器无法在.m文件中找到实现,因此您需要为每个接口在.m文件中实现它。

要解决此错误:

1.在.m文件中,提供每个接口的实现。 2.重建

下面的方法让我在Xcode 5.1上对64位模拟器和retina iPad Mini进行GPUImage编译而没有错误,而不需要从Valid Architectures列表中删除arm64(这违背了拥有一个64位设备来测试64位性能的目的)。

从GitHub页面https://github.com/BradLarson/GPUImage下载。zip文件夹

解压缩,并导航到“框架”文件夹。从这里,添加并复制Source文件夹到你的Xcode项目中。确保勾选了“将项目复制到目标组的文件夹”,并且勾选了“为任何添加的文件夹创建组”。这将复制通用,iOS和Mac头文件/实现文件到你的项目。

如果你不需要Mac文件,因为你正在为iOS编译,你可以在复制文件到你的项目之前删除Mac文件夹,或者简单地从Xcode中删除组。

一旦你将Source文件夹添加到你的项目中,只需使用以下命令开始使用GPUImage的类/方法:

#import "Source/GPUImage.h" 

有几件事需要指出:

If you get an error saying 'Cocoa' not found, you've added the Mac folder/headers into your iOS project - simply delete the Mac group/files from your project and the warning will vanish If you rename the Source folder (not the group in Xcode), use that name instead of "Source/GPUImage.h" in the #import instruction. So if you rename the folder to GPUImageFiles before you add to your project, use: #import "GPUImageFiles/GPUImage.h Obviously ensure arm64 is selected in the Valid Architectures list to take advantage of the A7 64-bit processor! This isn't a GPUImage.framework bundle (such as if you downloaded the framework from http://www.raywenderlich.com/60968/ios-7-blur-effects-gpuimage) so it may not the correct way to use GPUImage that Brad Larson intended, but it works for my current SpriteKit project. There's no need to link to frameworks/libraries etc - just import the header and implementation source folder as described above

希望上面的内容能有所帮助——尽管这个问题被问了很多次,但似乎在任何地方都没有明确的说明,但不要害怕,GPUImage绝对适用于arm64架构!

我通过将有效的arch设置为armv7 armv7s,并在发布中将构建活动架构设置为YES,然后从命令行执行新的“pod install”来解决这个问题

我的问题是,我已经有一些Facebook sdk在我的项目(FBSDKLoginKit和FBSDKCoreKit)。

我只需要一个SDK (FBSDKShareKit)并导入它,从而给出了“未定义的arm64符号架构”。

由于FBSDKShareKit依赖于更新版本的FBSDKCoreKit,通过更新其他框架,一切都重新工作了。

对于我来说,我在xcode 7.2 For iOS中使用opencv 2.4.9,出现了上述错误,我通过pod install使用opencv而不是离线opencv框架解决了这些错误。

你可以尝试添加下面的opencv pod文本,如果你使用了离线的opencv框架,可以删除。

豆荚“打开”,“2.4.9”