XCode 7.3.1,“架构 arm64 的未定义符号" [英] XCode 7.3.1, "Undefined symbols for architecture arm64"

查看:46
本文介绍了XCode 7.3.1,“架构 arm64 的未定义符号"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I have a Swift 2.x app that I am trying to use this Obj-C library with: 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:

架构 arm64 的未定义符号:_OBJC_CLASS_$_GBPing",引用自:在Pinger.o_OBJC_CLASS_$_GBPingSummary"中为__ObjC.GBPing输入元数据访问器,引用自:为 __ObjC.GBPingSummary 在 Pinger.old 中输入元数据访问器:找不到架构 arm64 clang 的符号:错误:链接器命令失败,退出代码为 1(使用 -v 查看调用)

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).

I have searched for and found some posts about "symbols not found for architecture arm64" but have not been able to get this working. I am quite new to iOS development, so XCode & Swift are both fairly new to me (and I have never done Obj-C).

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

Since I am only using .h and .m files from this library, aren't the needed object files supposed to be built from these? So why is arm64 not supported and how can I fix it?

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

注意:我的其他链接器标志"设置为空,但我确实尝试添加 $(inherited),但没有帮助.我不想删除 arm64 作为架构.最后,这是一款企业应用,只能在 iPad Air 2 和 iPad Mini 4(iOS 9.2 及更高版本)上运行

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. Lastly, this is an Enterprise app that will only run on iPad Air 2 and iPad Mini 4 (iOS 9.2 and up)

推荐答案

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

Check your target Build Phases ->Compile Sources to make sure did compile for GBPing.m and GBPingSummary.m.

如果没有,只需将所有库 .m 文件添加到编译源.

if not, just add all library .m file to Compile Sources.

这篇关于XCode 7.3.1,“架构 arm64 的未定义符号"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆