简体   繁体   English

XCode 7.3.1,“架构arm64的未定义符号”

[英]XCode 7.3.1, “Undefined symbols for architecture arm64”

I have a Swift 2.x app that I am trying to use this Obj-C library with: https://github.com/lmirosevic/GBPing 我有一个Swift 2.x应用程序,我试图使用这个Obj-C库: https//github.com/lmirosevic/GBPing

I have added the header file to my bridging header: 我已将头文件添加到我的桥接头:

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

When I am trying to build, I get this linker error: 当我尝试构建时,我收到此链接器错误:

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的未定义符号:“_ OBJC_CLASS _ $ _ GBPing”,引自:Pinger.o中的__ObjC.GBPing的类型元数据访问器“_OBJC_CLASS _ $ _ GBPingSummary”,引自:Pinger.o中的__ObjC.GBPingSummary的类型元数据访问器:符号(符号) s)找不到架构arm64 clang:错误:链接器命令失败,退出代码为1(使用-v查看调用)

I have searched for and found some posts about "symbols not found for architecture arm64" but have not been able to get this working. 我搜索并发现了一些关于“找不到架构arm64的符号”的帖子,但一直无法使用。 I am quite new to iOS development, so XCode & Swift are both fairly new to me (and I have never done Obj-C). 我对iOS开发很新,所以XCode和Swift对我来说都是新手(我从未做过Obj-C)。

Since I am only using .h and .m files from this library, aren't the needed object files supposed to be built from these? 因为我只使用来自这个库的.h和.m文件,不是应该从这些文件构建的所需对象文件? So why is arm64 not supported and how can I fix it? 那么为什么不支持arm64,我该如何解决呢?

Basically, I just need help getting this GBPing library to compile properly in my Swift app so that I can use it... 基本上,我只需要帮助让这个GBPing库在我的Swift应用程序中正确编译,以便我可以使用它...

Notes: My "Other Linker Flags" setting is empty, but I did try adding $(inherited), which did not help. 注意:我的“其他链接器标志”设置为空,但我确实尝试添加$(继承),这没有帮助。 I do not want to remove arm64 as an architecture. 我不想删除arm64作为架构。 Lastly, this is an Enterprise app that will only run on iPad Air 2 and iPad Mini 4 (iOS 9.2 and up) 最后,这是一款只能在iPad Air 2和iPad Mini 4(iOS 9.2及更高版本)上运行的企业应用程序

Check your target Build Phases ->Compile Sources to make sure did compile for GBPing.m and GBPingSummary.m. 检查目标Build Phases - > Compile Sources以确保编译GBPing.m和GBPingSummary.m。

if not, just add all library .m file to Compile Sources. 如果没有,只需将所有库.m文件添加到编译源。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM