2013-02-13 28 views
8

雖然我很熟悉在Objective-C中開發,但在涉及錯誤解釋時我仍然認爲自己有點n00b。我正在研究其他人也在研究的工作申請。我相信我們可能有不同版本的Xcode,一個開發人員有一臺PC(其他人和我有一臺MacBook)。我正在使用Xcode 4.5.1。截斷的胖文件鏈接器錯誤

的問題

我正在以下蘋果Mach-O的連接錯誤

ld: truncated fat file. Slice from 68 to 2783300 is past end of file with length 135 for architecture i386 clang: error: linker command failed with exit code 1 (use -v to see invocation)

完整的錯誤如下(改名路徑):

Ld build/Debug-iphonesimulator/MyApp.app/MyApp normal i386 cd /Users/me/Documents/MyApp/trunk setenv IPHONEOS_DEPLOYMENT_TARGET 5.1 setenv 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:/usr/local/bin:/usr/X11/bin:/opt/local/bin:/usr/local/git/bin" /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch i386 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.0.sdk -L/Users/me/Documents/MyApp/trunk/build/Debug-iphonesimulator -F/Users/me/Documents/MyApp/trunk/build/Debug-iphonesimulator -F/Users/me/Documents/MyApp/trunk -filelist /Users/me/Documents/MyApp/trunk/build/MyApp.build/Debug-iphonesimulator/MyApp.build/Objects-normal/i386/MyApp.LinkFileList -Xlinker -objc_abi_version -Xlinker 2 -lsqlite3.0 -v -fobjc-arc -fobjc-link-runtime -Xlinker -no_implicit_dylibs -mios-simulator-version-min=5.1 -framework MobileCoreServices -weak_framework Accounts -weak_framework AdSupport -weak_framework Social -framework CoreBluetooth -framework MediaPlayer -framework QuartzCore -framework UIKit -framework Foundation -framework CoreGraphics -framework FacebookSDK -o /Users/me/Documents/MyApp/trunk/build/Debug-iphonesimulator/MyApp.app/MyApp

Apple clang version 4.1 (tags/Apple/clang-421.11.66) (based on LLVM 3.1svn) Target: i386-apple-darwin11.4.2 Thread model: posix "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld" -demangle -dynamic -arch i386 -ios_simulator_version_min 5.1.0 -syslibroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.0.sdk -o /Users/me/Documents/MyApp/trunk/build/Debug-iphonesimulator/MyApp.app/MyApp -lcrt1.o -L/Users/me/Documents/MyApp/trunk/build/Debug-iphonesimulator -filelist /Users/me/Documents/MyApp/trunk/build/MyApp.build/Debug-iphonesimulator/MyApp.build/Objects-normal/i386/MyApp.LinkFileList -objc_abi_version 2 -lsqlite3.0 -no_implicit_dylibs -framework MobileCoreServices -weak_framework Accounts -weak_framework AdSupport -weak_framework Social -framework CoreBluetooth -framework MediaPlayer -framework QuartzCore -framework UIKit -framework Foundation -framework CoreGraphics -framework FacebookSDK -force_load /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/arc/libarclite_iphonesimulator.a -framework Foundation -lobjc -lSystem /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/4.1/lib/darwin/libclang_rt.ios.a -F/Users/me/Documents/MyApp/trunk/build/Debug-iphonesimulator -F/Users/me/MyApp/trunk ld: truncated fat file. Slice from 68 to 2783300 is past end of file with length 135 for architecture i386 clang: error: linker command failed with exit code 1 (use -v to see invocation)

我發現接近沒有關於此錯誤的文檔。有什麼問題?如何解決這樣的錯誤?

回答

0

我讀這個答案的地方,

符號鏈接文件和文件夾(在你的情況下,一些框架)被轉化成脂肪的文件時,他們是從MAC-OS移動/ X到Windows。因此,無論何時我們將項目框架從您的MAC複製粘貼/簽出到Windows或反之亦然,它們都會根據符號鏈接進行修改。

所以你可以做的只是檢查你的項目文件並單獨替換框架(請注意你將要替換的框架應該從MAC下載,而不是WINDOWS)。

希望這可以幫助別人!