2015-07-20 95 views
0

我將我的同事的macbook的xcode更新爲6.4,並從我們的顛覆回購中檢出項目。清理並構建它,但出現錯誤消息,指出「ld:file not found ...」後面跟着「clang:error:linker命令失敗,退出代碼1(使用-v查看調用)」。這些消息被歸類爲「Apple Mach-O鏈接器錯誤」。這些錯誤不會發生在我用來開發此項目的Macbook上。鏈接器命令失敗,退出代碼1 xcode 6.4

找到了其他人嘗試過的一些解決方案,但它對我無效。 這裏是我的設置:

  1. 基地SDK:最新的iOS(iOS版8.4)
  2. 生成設置>架構>構建有源體系僅>調試>是。只有調試是。
  3. 生成設置>架構>有效架構> arm64 ARM7 armv7s
  4. 部署信息>部署目標> 8.2
  5. 我使用的Photos.framework和MobileCoreServices.framework

我懷疑一些圖書館或者我的同事的MacBook上缺少文件,但無法確定。有沒有辦法找到這個?我也很樂意嘗試其他解決方案。

我發現問題在於我從顛覆中檢出的項目。在具有我的項目的同一臺計算機上,如果我要從顛覆中結帳,它將不會運行,並且與我的同事的筆記本電腦有相同的錯誤消息。

這裏是我做了什麼:

  1. 導航到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) 

回答

1

從另一個問題here找到解決方案。

我用@ Chepe77答案來解決我的問題。我將在這裏複製並粘貼@Chepe77答案。

  1. 在項目導航器中選擇您的項目。
  2. 選擇下的目標
  3. 在常規選項卡上的YourProjectTests改變從下拉
  4. 編譯和運行主機應用。
+0

我有這個相同的錯誤,但不工作...自從yeseterday – 2015-09-17 05:25:50

1

清潔您的Xcode項目。然後重建你的項目。

+1

做了幾次。事實上,我每次都會嘗試一種可能的解決方案。 – winhung

0

你構建設置應該是

Architectures > Valid Architectures > arm64 armv7 armv7s

和體系結構部分中選擇標準架構。

並檢查您是否錯過了有用的框架。

+0

是的,他們是這些體系結構,是必要的框架。再次移除並添加它們並不能解決問題。但是,謝謝你的回覆。 – winhung

0

你的建築應該改變arm7 - > armv7。

相關問題