ios – 截断的胖文件链接器错误

前端之家收集整理的这篇文章主要介绍了ios – 截断的胖文件链接器错误前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
虽然我熟悉Objective-C的开发,但在错误解释方面,我仍然认为自己有点像n00b.我正致力于其他人也在努力的工作申请.我相信我们可能有不同版本的 Xcode,一个开发人员有一台PC(其他人和我有一台MacBook).我正在使用Xcode 4.5.1.

问题

我得到以下Apple 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)

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

解决方法

我在某处读到了这个答案,

文件文件夹的符号链接(在您的情况下是一些框架)在从MAC-OS / X移动到Windows时会变成胖文件.因此,无论何时我们将项目框架从MAC复制粘贴/签出到窗口,反之亦然,它都会被更改,文件会根据符号链接进行修改.

所以你可以做的只是检查你的项目文件并单独替换框架(请注意你要替换的框架应该是新的或从MAC,而不是WINDOWS的某处复制).

希望这有助于某人!

原文链接:https://www.f2er.com/iOS/333970.html

猜你在找的iOS相关文章