ios - X代码 7.3.1, "Undefined symbols for architecture arm64"

标签 ios objective-c swift xcode

我有一个 Swift 2.x 应用程序,我正在尝试将此 Obj-C 库用于: https://github.com/lmirosevic/GBPing

我已将头文件添加到我的桥接 header 中:

#import "GBPing-master/GBPing/GBPing.h"

当我尝试构建时,出现此链接器错误:

Undefined symbols for architecture arm64: "_OBJC_CLASS_$_GBPing", referenced from: type metadata accessor for __ObjC.GBPing in Pinger.o "_OBJC_CLASS_$_GBPingSummary", referenced from: type metadata accessor for __ObjC.GBPingSummary in Pinger.o ld: symbol(s) not found for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation)

我搜索并找到了一些关于“未找到体系结构 arm64 的符号”的帖子,但无法使其正常工作。我是 iOS 开发的新手,所以 XCode 和 Swift 对我来说都是新手(而且我从未接触过 Obj-C)。

因为我只使用这个库中的 .h 和 .m 文件,难道所需的目标文件不应该从这些文件构建吗?那么为什么不支持 arm64,我该如何解决呢?

基本上,我只需要帮助让这个 GBPing 库在我的 Swift 应用程序中正确编译,以便我可以使用它...

注意:我的“Other Linker Flags”设置为空,但我确实尝试添加 $(inherited),但没有帮助。我不想删除 arm64 作为架构。最后,这是一个企业应用程序,只能在 iPad Air 2 和 iPad Mini 4(iOS 9.2 及更高版本)上运行

最佳答案

检查您的目标构建阶段 -> 编译源以确保为 GBPing.m 和 GBPingSummary.m 编译。

如果没有,只需将所有库 .m 文件添加到 Compile Sources。

关于ios - X代码 7.3.1, "Undefined symbols for architecture arm64",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38363526/

相关文章:

objective-c - 删除 obj-c 中的对象

objective-c - 带背景的自定义 AlertView

ios 9 - xcode 7 - SFSafariViewController - 图片上传 - 相机黑屏

ios - 当应用程序在后台运行在模拟器上但不在设备上运行时更新位置(iOS 9)

ios - 不同 View 的 CAGradientLayer

ios - Xamarin iOS - 缩放后绘制到图像上

swift - 如何在特定时间快速运行代码

objective-c - setNeedsDisplay 在一个大的 UIView 上导致

objective-c - 我可以指定应在 AFNetworking 中缓存多长时间的响应吗?

ios - ScrollView 内的 imageView 上的多个动画