Xcode 8.1 架构 x86_64 错误的未定义符号

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/40745020/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 09:36:25  来源:igfitidea点击:

Xcode 8.1 Undefined symbols for architecture x86_64 Error

iosobjective-ciphonexcodex86-64

提问by ünal ?ztürk

Undefined symbols for architecture x86_64:
"_BROADCAST_MODE_IBEACON", referenced from:
-[MainViewController tableView:cellForRowAtIndexPath:] in MainViewController.o
"_OBJC_CLASS_$_TZBeaconSDK", referenced from:
  objc-class-ref in MainViewController.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

I take that error when I want to use simulator. There is no problem when I build it on iPhone. There is only problem when I use simulator. I have tried to change Architectures from Build settings, error text changes as i386 but problem is same.

当我想使用模拟器时,我会犯这个错误。当我在 iPhone 上构建它时没有问题。只有当我使用模拟器时才会出现问题。我试图从构建设置更改架构,错误文本更改为 i386,但问题相同。

I use that sdk; TZBeacon

我使用那个sdk;TZ信标

Is there any problem with sdk? Could you help me to solve that problem?

sdk有问题吗?你能帮我解决这个问题吗?

回答by Duyen-Hoa

Your library does not support simulator. Run this command line to see which architecture that it supports:

您的库不支持模拟器。运行此命令行以查看它支持的架构:

lipo -info libTZBeaconSDK.a

the result is: Architectures in the fat file: libTZBeaconSDK.a are: armv7 arm64

结果是:胖文件中的架构:libTZBeaconSDK.a 是:armv7 arm64

So, you have to test in a device, not in simulator!

因此,您必须在设备中进行测试,而不是在模拟器中!

回答by dlbuckley

Typically you get that error in the simulator if the architecture of the framework is built for the device. You need to use a version of the framework that is built for the simulator to run it on the simulator. This is something that should be provided by the framework vendor.

如果框架的架构是为设备构建的,通常你会在模拟器中遇到该错误。您需要使用为模拟器构建的框架版本才能在模拟器上运行它。这是框架供应商应该提供的东西。

If they don't provide one then look into only including that framework when building to the device and not to the simulator. There is another SO answer here to point you in the right direction: How to only include a framework when building for device, not iOS Simulator?

如果他们不提供,那么在构建到设备而不是模拟器时只考虑包含该框架。这里还有另一个 SO 答案可以为您指明正确的方向:如何在为设备而不是 iOS 模拟器构建时只包含一个框架?

回答by PrasannaKumar

Simple trick here: Go-> Go To Folder"/Library/Developer/Xcode" delete Derived datanext clean your project then Run.

这里的简单技巧:Go-> Go To Folder" /Library/Developer/Xcode" delete Derived datanext clean your project 然后Run