我有一个 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/