截断的胖文件链接器错误

Phi*_*hil 8 xcode linker-errors ios

虽然我对使用Objective-C进行开发很熟悉,但在错误解释方面,我仍然认为自己有点像n00b.我正致力于其他人也在努力的工作申请.我相信我们可能有不同版本的Xcode,一个开发人员有一台PC(其他人和我有一台MacBook).我正在使用Xcode 4.5.1.

问题

我得到以下Apple Mach-O链接器错误:

ld:截断的胖文件.对于体系结构i386 clang,从68到2783300的切片是文件末尾,长度为135:错误:链接器命令失败,退出代码为1(使用-v查看调用)

完整错误如下(路径重命名):

Ld build/Debug-iphonesimulator/MyApp.app/MyApp普通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 /斌:/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 4.1版(标签/ Apple/clang-421.11.66)(基于LLVM 3.1svn)目标:i386-apple-darwin11.4.2线程模型: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社交框架CoreBluetooth -framework MediaPlayer -framework QuartzCore -framework UIKit -framework Foundation-framework CoreGraphics -framework Facebo okSDK -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:截断的胖文件.对于体系结构i386 clang,从68到2783300的切片是文件末尾,长度为135:错误:链接器命令失败,退出代码为1(使用-v查看调用)

我发现这个错误几乎没有文档.有什么问题?我该如何解决这样的错误?

小智 2

我在某处读过这个答案,

当文件和文件夹(在您的情况下是某些框架)从 MAC-OS/X 移动到 Windows 时,它们的符号链接会变成胖文件。因此,每当我们将项目框架从 MAC 复制粘贴/检出到 Windows 或反之亦然时,它都会发生更改,文件也会根据符号链接进行修改。

所以你能做的就是检查你的项目文件并单独替换框架(请注意,你要替换的框架应该是新鲜下载的或从 MAC 而不是 WINDOWS 的某个地方复制)。

希望这对某人有帮助!