
Undefined symbols for architecture armv7:
“_swift_stdlib_compareNsstringDeterministicUnicodeCollation”,referenced from:…
ld: symbol(s) not found for architecture armv7
clang: error: linker command Failed with exit code 1 (use -v to see invocation)
我已经看到其他SO帖子建议删除Derived Data文件夹和/或使用Clean Build Folder选项来解决此错误,但在我的情况下,该解决方案根本没有帮助。关于我的代码或我正在使用的CocoaPods没有任何改变,因为Xcode 6 beta 5是它最后一次工作。
有任何想法吗?
编辑:
错误日志的完整发布:
解决方法 这里发生的事情与您的派生数据位置无关。Undefined symbols for architecture arm64:
“_swift_stdlib_compareNsstringDeterministicUnicodeCollation”,referenced from:
TFC12MyProject21barcodeVIEwController13captureOutputfS0_FTGSQCSo15AVCaptureOutput_24dIDOutputMetadataObjectsGSQGSaPSs9AnyObject___14fromConnectionGSQCSo19AVCaptureConnection__T_ in barcodeVIEwController.o
“__TFSs21_arrayConditionalCastU___FGSaQ__GSqGSaQ0_“,referenced from:
TFC12MyProject27SessionstableVIEwController17vIEwWilldisappearfS0_FSbT_ in SessionstableVIEwController.o
“__TFSs15_arrayForceCastU___FGSaQ__GSaQ0“,referenced from:
__TFC12MyProject7RestAPI12tokenMapPingfS0_FT_CSo15RKEntityMapPing in RestAPI.o
__TFC12MyProject28AttendeestableVIEwControllerg24fetchedResultsControllerCSo26NSFetchedResultsController in AttendeestableVIEwController.o
__TFC12MyProject27SessionstableVIEwControllerg24fetchedResultsControllerCSo26NSFetchedResultsController in SessionstableVIEwController.o
__TFC12MyProject21barcodeVIEwController13startScanningfS0_FT_Sb in barcodeVIEwController.o
“__TFSs26_forceBrIDgeFromObjectiveCU__FTPSs9AnyObject_MQ__Q_”,referenced from:
__TFC12MyProject7RestAPI12resetRestKitfS0_FT_T_ in RestAPI.o
__TFC12MyProject16BluetoothManager17_startAdvertisingfS0_FT_T_ in BluetoothManager.o
__TFC12MyProject19LoginVIEwController32registerForKeyboardNotificationsfS0_FT_T_ in LoginVIEwController.o
__TFC12MyProject19LoginVIEwController35deregisterFromKeyboardNotificationsfS0_FT_T_ in LoginVIEwController.o
__TFC12MyProject19LoginVIEwController16callProcessLoginfS0_FT_T_ in LoginVIEwController.o
__TFC12MyProject21CheckinVIEwController16enableBeaconModefS0_FT_T_ in CheckinVIEwController.o
__TFC12MyProject21barcodeVIEwController13startScanningfS0_FT_Sb in barcodeVIEwController.o
…
ld: symbol(s) not found for architecture arm64
clang: error: linker command Failed with exit code 1 (use -v to see invocation)
构建swift应用程序时,它会经历几个步骤:
>编写辅助文件
>创建产品结构
>为每个架构编译swift源
>复制资源规则pList
>复制应用程序桥接标题
>链接每个体系结构的swift运行时库
>为每个架构复制应用程序swift模块
>创建应用程序二进制文件
>复制资源构建阶段
>将swift标准库复制到应用程序中
>打包它
>签名
呼!好多啊。链接swift运行时库时,您的构建失败。它们位于Xcode开发人员目录中的Toolchains / XcodeDefault.xctoolchain / usr / lib / swift / iphoneos中。具体来说,未正确链接的库是libswiftCore.dylib。如果在该库上使用nm,则可以看到它定义了您的第一个缺失符号:
quellish% nm /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/libswiftCore.dylib | grep compareNsstringDeterministicUnicodeCollation00197c8c T _swift_stdlib_compareNsstringDeterministicUnicodeCollation000000000018352c T _swift_stdlib_compareNsstringDeterministicUnicodeCollation
您还可以使用lipo查看文件中的架构:
quellish% xcrun lipo -info /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/libswiftCore.dylibArchitectures in the fat file: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/libswiftCore.dylib are: armv7 arm64
它包含armv7和arm64。这不是图书馆架构的问题。
链接快速标准库是行不通的。源代码控制或迁移Xcode版本可能导致您的项目文件丢失了部分链接步骤,或者根本无法找到它需要链接的库。 Xcode项目文件很复杂并且使用了很多引用 – 合并等可能导致关键引用与链接步骤分离。如果没有完整的构建日志并查看您的计算机,则可能无法分辨。
正如您可能猜到的,该库与项目的派生数据位置无关。
不幸的是,前进的最佳方式是重新创建项目文件。将已损坏项目的构建日志与正确构建的快速项目进行比较可能会提供一些见解,但也可能浪费时间 – 可修复的问题可能是问题,但更有可能不是。
我鼓励你提交一个BUG并用它包含麻烦的项目文件。
总结以上是内存溢出为你收集整理的ios – Xcode 6链接器错误 – 架构armv7的未定义符号全部内容,希望文章能够帮你解决ios – Xcode 6链接器错误 – 架构armv7的未定义符号所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)