xcode Gcc-4.2 失败,退出代码 1 错误
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/6210528/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Gcc-4.2 failed with exit code 1 Error
提问by Anand
I am getting this error when i am trying to build my app. In the simulator it works fine but when coming to build for ipa it gives the following error:
当我尝试构建我的应用程序时出现此错误。在模拟器中它工作正常,但是当为 ipa 构建时,它给出了以下错误:
Command /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc-4.2 failed with exit code 1
命令 /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc-4.2 失败,退出代码为 1
What is causing this error?
是什么导致了这个错误?
Edited
已编辑
Ld build/halalgauge.build/Release-iphoneos/halalgauge.build/Objects-normal/armv6/halalgauge normal armv6 cd /Users/admin/Desktop/ShopSavvy setenv IPHONEOS_DEPLOYMENT_TARGET 4.2 setenv PATH "/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin" /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc-4.2 -arch armv6 -isysroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.2.sdk -L/Users/admin/Desktop/ShopSavvy/build/Release-iphoneos -L/Users/admin/Desktop/ShopSavvy -L/Users/admin/Desktop/ShopSavvy/Classes/ZBarSDK -L/Users/admin/Desktop/ShopSavvy/Classes/ScannerKit-4.0.3 -F/Users/admin/Desktop/ShopSavvy/build/Release-iphoneos -filelist /Users/admin/Desktop/ShopSavvy/build/halalgauge.build/Release-iphoneos/halalgauge.build/Objects-normal/armv6/halalgauge.LinkFileList -Xlinker -map -Xlinker /Users/admin/Desktop/ShopSavvy/build/halalgauge.build/Release-iphoneos/halalgauge.build/halalgauge-LinkMap-normal-armv6.txt -dead_strip all_load -lstdc++ -miphoneos-version-min=4.2 -framework CoreGraphics -framework AVFoundation -framework CoreVideo -framework CoreMedia -framework Foundation -framework AudioToolbox -framework QuartzCore -framework UIKit -framework iAd -lsqlite3.0 -framework MessageUI -framework AddressBook -framework AddressBookUI -framework MapKit -framework CoreLocation -liconv -lScannerKit -framework SystemConfiguration -framework MediaPlayer -o /Users/admin/Desktop/ShopSavvy/build/halalgauge.build/Release-iphoneos/halalgauge.build/Objects-normal/armv6/halalgauge
arm-apple-darwin10-gcc-4.2.1: all_load: No such file or directory Command /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc-4.2 failed with exit code 1
ld build/halalgauge.build/Release-iphoneos/halalgauge.build/Objects-normal/armv6/halalgauge normal armv6 cd /Users/admin/Desktop/ShopSavvy setenv IPHONEOS_DEPLOYMENT_TARGET 4.2 setenv PATH》/Developer/Platforms/iPhoneOS.platform/Developer usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin" /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc-4.2 -arch armv6 -isysroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.2.sdk -L/Users/admin/Desktop/ShopSavvy/build/Release-iphoneos -L/Users/admin/Desktop/ShopSavvy -L/Users/admin /Desktop/ShopSavvy/Classes/ZBarSDK -L/Users/admin/Desktop/ShopSavvy/Classes/ScannerKit-4.0.3 -F/Users/admin/Desktop/ShopSavvy/build/Release-iphoneos -filelist /Users/admin/Desktop /ShopSavvy/build/halalgauge.build/Release-iphoneos/halalgauge。build/Objects-normal/armv6/halalgauge.LinkFileList -Xlinker -map -Xlinker /Users/admin/Desktop/ShopSavvy/build/halalgauge.build/Release-iphoneos/halalgauge.build/halalgauge-LinkMap-normal-armv6.txt - dead_strip all_load -lstdc++ -miphoneos-version-min=4.2 -framework CoreGraphics -framework AVFoundation -framework CoreVideo -framework CoreMedia -framework Foundation -framework AudioToolbox -framework QuartzCore -framework UIKit -framework iAd -lsqlite3.0 -framework MessageUI -framework AddressBook - framework AddressBookUI -framework MapKit -framework CoreLocation -liconv -lScannerKit -framework SystemConfiguration -framework MediaPlayer -o /Users/admin/Desktop/ShopSavvy/build/halalgauge.build/Release-iphoneos/halalgauge.build/Objects-normal/armv6/halalgaugeLinkFileList -Xlinker -map -Xlinker /Users/admin/Desktop/ShopSavvy/build/halalgauge.build/Release-iphoneos/halalgauge.build/halalgauge-LinkMap-normal-armv6.txt -dead_strip all_load -lstdc++ -miphoneos-version-min =4.2 -framework CoreGraphics -framework AVFoundation -framework CoreVideo -framework CoreMedia -framework Foundation -framework AudioToolbox -framework QuartzCore -framework UIKit -framework iAd -lsqlite3.0 -framework MessageUI -framework AddressBook -framework AddressBookUI -framework MapKit -framework CoreLocation -liconv -lScannerKit -framework SystemConfiguration -framework MediaPlayer -o /Users/admin/Desktop/ShopSavvy/build/halalgauge.build/Release-iphoneos/halalgauge.build/Objects-normal/armv6/halalgaugeLinkFileList -Xlinker -map -Xlinker /Users/admin/Desktop/ShopSavvy/build/halalgauge.build/Release-iphoneos/halalgauge.build/halalgauge-LinkMap-normal-armv6.txt -dead_strip all_load -lstdc++ -miphoneos-version-min =4.2 -framework CoreGraphics -framework AVFoundation -framework CoreVideo -framework CoreMedia -framework Foundation -framework AudioToolbox -framework QuartzCore -framework UIKit -framework iAd -lsqlite3.0 -framework MessageUI -framework AddressBook -framework AddressBookUI -framework MapKit -framework CoreLocation -liconv -lScannerKit -framework SystemConfiguration -framework MediaPlayer -o /Users/admin/Desktop/ShopSavvy/build/halalgauge.build/Release-iphoneos/halalgauge.build/Objects-normal/armv6/halalgaugetxt -dead_strip all_load -lstdc++ -miphoneos-version-min=4.2 -framework CoreGraphics -framework AVFoundation -framework CoreVideo -framework CoreMedia -framework Foundation -framework AudioToolbox -framework QuartzCore -framework UIKit -framework iAd -lsqlite3.0 -framework MessageUI -framework AddressBook -framework AddressBookUI -framework MapKit -framework CoreLocation -liconv -lScannerKit -framework SystemConfiguration -framework MediaPlayer -o /Users/admin/Desktop/ShopSavvy/build/halalgauge.build/Release-iphoneos/halalgauge.build/Objects-normal/armv6 /halalgaugetxt -dead_strip all_load -lstdc++ -miphoneos-version-min=4.2 -framework CoreGraphics -framework AVFoundation -framework CoreVideo -framework CoreMedia -framework Foundation -framework AudioToolbox -framework QuartzCore -framework UIKit -framework iAd -lsqlite3.0 -framework MessageUI -framework AddressBook -framework AddressBookUI -framework MapKit -framework CoreLocation -liconv -lScannerKit -framework SystemConfiguration -framework MediaPlayer -o /Users/admin/Desktop/ShopSavvy/build/halalgauge.build/Release-iphoneos/halalgauge.build/Objects-normal/armv6 /halalgauge0 -framework MessageUI -framework AddressBook -framework AddressBookUI -framework MapKit -framework CoreLocation -liconv -lScannerKit -framework SystemConfiguration -framework MediaPlayer -o /Users/admin/Desktop/ShopSavvy/build/halalgauge.build/Release-iphoneos/halalgauge.build /Objects-normal/armv6/halalgauge0 -framework MessageUI -framework AddressBook -framework AddressBookUI -framework MapKit -framework CoreLocation -liconv -lScannerKit -framework SystemConfiguration -framework MediaPlayer -o /Users/admin/Desktop/ShopSavvy/build/halalgauge.build/Release-iphoneos/halalgauge.build /Objects-normal/armv6/halalgauge
arm-apple-darwin10-gcc-4.2.1: all_load: No such file or directory Command /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc-4.2 failed with exit code 1
回答by
If you inspect the linker invocation, you'll see the following:
如果您检查链接器调用,您将看到以下内容:
-dead_strip all_load -lstdc++
The linker interprets that all_load
as a file that must be linked, hence the error:
链接器将其解释all_load
为必须链接的文件,因此出现错误:
arm-apple-darwin10-gcc-4.2.1: all_load: No such file or directory
arm-apple-darwin10-gcc-4.2.1: all_load: 没有那个文件或目录
You need to specify -all_load
(with an hyphen) instead of all_load
in the linker flags.
您需要指定-all_load
(使用连字符)而不是all_load
在链接器标志中。
回答by Alan Zeino
Restart your Mac, and if all else fails choose either LLVM-GCC or LLVM as a compiler.
重新启动您的 Mac,如果所有其他方法都失败,请选择 LLVM-GCC 或 LLVM 作为编译器。
回答by Bolek Tekielski
Could be due to multiple errors.
可能是由于多个错误。
In XCode's build window select All Messages, that should give more meaningful information, which you can post here to help trace the problem.
在 XCode 的构建窗口中选择 All Messages,这应该会提供更有意义的信息,您可以在此处发布这些信息以帮助跟踪问题。
回答by SURESH SANKE
Add required library from the SDK libraries.
从 SDK 库中添加所需的库。