我將我的同事的macbook的xcode更新爲6.4,並從我們的顛覆回購中檢出項目。清理並構建它,但出現錯誤消息,指出「ld:file not found ...」後面跟着「clang:error:linker命令失敗,退出代碼1(使用-v查看調用)」。這些消息被歸類爲「Apple Mach-O鏈接器錯誤」。這些錯誤不會發生在我用來開發此項目的Macbook上。鏈接器命令失敗,退出代碼1 xcode 6.4
找到了其他人嘗試過的一些解決方案,但它對我無效。 這裏是我的設置:
- 基地SDK:最新的iOS(iOS版8.4)
- 生成設置>架構>構建有源體系僅>調試>是。只有調試是。
- 生成設置>架構>有效架構> arm64 ARM7 armv7s
- 部署信息>部署目標> 8.2
- 我使用的Photos.framework和MobileCoreServices.framework
我懷疑一些圖書館或者我的同事的MacBook上缺少文件,但無法確定。有沒有辦法找到這個?我也很樂意嘗試其他解決方案。
我發現問題在於我從顛覆中檢出的項目。在具有我的項目的同一臺計算機上,如果我要從顛覆中結帳,它將不會運行,並且與我的同事的筆記本電腦有相同的錯誤消息。
這裏是我做了什麼:
- 導航到DerivedData文件夾,並刪除了這一切。清理並構建解決方案。
如下整體錯誤消息:按CMD + Shift + K
Ld /Users/XXX/Library/Developer/Xcode/DerivedData/MyProj-fnouqouxukjwszadgmsdxsqmdgbt/Build/Products/Debug-iphonesimulator/MyProjTests.xctest/MyProjTests normal x86_64
cd /Users/XXX/xxxmios/MyProj
export IPHONEOS_DEPLOYMENT_TARGET=8.2
export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch x86_64 -bundle -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.4.sdk -L/Users/XXX/Library/Developer/Xcode/DerivedData/MyProj-fnouqouxukjwszadgmsdxsqmdgbt/Build/Products/Debug-iphonesimulator -F/Users/XXX/Library/Developer/Xcode/DerivedData/MyProj-fnouqouxukjwszadgmsdxsqmdgbt/Build/Products/Debug-iphonesimulator -F/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.4.sdk/Developer/Library/Frameworks -F/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Frameworks -F/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.4.sdk/Developer/Library/Frameworks -filelist /Users/NIE/Library/Developer/Xcode/DerivedData/MyProj-fnouqouxukjwszadgmsdxsqmdgbt/Build/Intermediates/MyProj.build/Debug-iphonesimulator/MyProjTests.build/Objects-normal/x86_64/MyProjTests.LinkFileList -Xlinker -rpath -Xlinker @executable_path/Frameworks -Xlinker -rpath -Xlinker @loader_path/Frameworks -bundle_loader /Users/XXX/Library/Developer/Xcode/DerivedData/MyProj-fnouqouxukjwszadgmsdxsqmdgbt/Build/Products/Debug-iphonesimulator/MyProj.app/MyProj -Xlinker -objc_abi_version -Xlinker 2 -framework XCTest -L/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator -Xlinker -add_ast_path -Xlinker /Users/XXX/Library/Developer/Xcode/DerivedData/MyProj-fnouqouxukjwszadgmsdxsqmdgbt/Build/Intermediates/MyProj.build/Debug-iphonesimulator/MyProjTests.build/Objects-normal/x86_64/MyProjTests.swiftmodule -mios-simulator-version-min=8.2 -Xlinker -dependency_info -Xlinker /Users/XXX/Library/Developer/Xcode/DerivedData/MyProj-fnouqouxukjwszadgmsdxsqmdgbt/Build/Intermediates/MyProj.build/Debug-iphonesimulator/MyProjTests.build/Objects-normal/x86_64/MyProjTests_dependency_info.dat -o /Users/XXX/Library/Developer/Xcode/DerivedData/MyProj-fnouqouxukjwszadgmsdxsqmdgbt/Build/Products/Debug-iphonesimulator/MyProjTests.xctest/MyProjTests
ld: file not found: /Users/XXX/Library/Developer/Xcode/DerivedData/MyProj-fnouqouxukjwszadgmsdxsqmdgbt/Build/Products/Debug-iphonesimulator/MyProj.app/MyProj
clang: error: linker command failed with exit code 1 (use -v to see invocation)
我有這個相同的錯誤,但不工作...自從yeseterday – 2015-09-17 05:25:50