Iphone – Gcc-4.2 failed with exit code 1 Error

buildgcciphonexcode

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:

Command /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc-4.2 failed with exit code 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

Best Answer

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:

arm-apple-darwin10-gcc-4.2.1: all_load: No such file or directory

You need to specify -all_load (with an hyphen) instead of all_load in the linker flags.

Related Topic