Combining ARC and non-ARC files not working - iphone

Once I add the -fno-objc-arc flag to one or more individual files in Build Phases, my MyProject-Prefix.pch file is thrown into non-ARC mode, causing 150 warnings like "warning: no 'assign', 'retain', or 'copy' attribute is specified - 'assign' is assumed" to be thrown.
Here's the clang log output from compiling MyProject-Prefix.pch. As you can see, the -fobjc-arc flag appears, but later on, -no-fobjc-arc is added, which I'm assuming overrides ARC. This only happens if I add -fno-objc-arc to a single .m source file in Build Phases (the standard advice that everyone gets to mix ARC and non-ARC files).
Any ideas?
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x objective-c-header -arch i386 -fmessage-length=0 -std=gnu99 -fobjc-arc -Wno-trigraphs -fpascal-strings -O0 -Wno-missing-field-initializers -Wno-missing-prototypes -Wreturn-type -Wno-implicit-atomic-properties -Wformat -Wno-missing-braces -Wparentheses -Wswitch -Wno-unused-function -Wno-unused-label -Wno-unused-parameter -Wunused-variable -Wunused-value -Wno-uninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-sign-compare -Wno-shorten-64-to-32 -Wpointer-sign -Wno-newline-eof -Wno-selector -Wno-strict-selector-match -Wno-undeclared-selector -Wno-deprecated-implementations -DDEBUG -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.1.sdk -fexceptions -fasm-blocks -Wprotocol -Wdeprecated-declarations -mmacosx-version-min=10.6 -g -Wno-conversion -Wno-sign-conversion -fobjc-abi-version=2 -fobjc-legacy-dispatch "-DIBOutlet=__attribute__((iboutlet))" "-DIBOutletCollection(ClassName)=__attribute__((iboutletcollection(ClassName)))" "-DIBAction=void)__attribute__((ibaction)" -D__IPHONE_OS_VERSION_MIN_REQUIRED=50100 -iquote /Users/steve/Library/Developer/Xcode/DerivedData/MyProject-ajtusdfivjqtabgvzfuzqifdjuis/Build/Intermediates/MyProject.build/Debug-iphonesimulator/MyProject.build/MyProject-generated-files.hmap -I/Users/steve/Library/Developer/Xcode/DerivedData/MyProject-ajtusdfivjqtabgvzfuzqifdjuis/Build/Intermediates/MyProject.build/Debug-iphonesimulator/MyProject.build/MyProject-own-target-headers.hmap -I/Users/steve/Library/Developer/Xcode/DerivedData/MyProject-ajtusdfivjqtabgvzfuzqifdjuis/Build/Intermediates/MyProject.build/Debug-iphonesimulator/MyProject.build/MyProject-all-target-headers.hmap -iquote /Users/steve/Library/Developer/Xcode/DerivedData/MyProject-ajtusdfivjqtabgvzfuzqifdjuis/Build/Intermediates/MyProject.build/Debug-iphonesimulator/MyProject.build/MyProject-project-headers.hmap -iquoteOAuth2Client -iquoteOAuth2Client/Sources -iquoteOAuth2Client/Sources/OAuth2Client -I/Users/steve/Library/Developer/Xcode/DerivedData/MyProject-ajtusdfivjqtabgvzfuzqifdjuis/Build/Products/Debug-iphonesimulator/include -I../../Source/facebook-ios-sdk/src -I/Users/steve/Library/Developer/Xcode/DerivedData/MyProject-ajtusdfivjqtabgvzfuzqifdjuis/Build/Products/Debug-iphonesimulator/../three20 -I/Users/steve/Library/Developer/Xcode/DerivedData/MyProject-ajtusdfivjqtabgvzfuzqifdjuis/Build/Products/Debug-iphonesimulator/../../three20 -I../../Source/three20/Build/Products/three20 -I/Users/steve/Library/Developer/Xcode/DerivedData/MyProject-ajtusdfivjqtabgvzfuzqifdjuis/Build/Intermediates/MyProject.build/Debug-iphonesimulator/MyProject.build/DerivedSources/i386 -I/Users/steve/Library/Developer/Xcode/DerivedData/MyProject-ajtusdfivjqtabgvzfuzqifdjuis/Build/Intermediates/MyProject.build/Debug-iphonesimulator/MyProject.build/DerivedSources -F/Users/steve/Library/Developer/Xcode/DerivedData/MyProject-ajtusdfivjqtabgvzfuzqifdjuis/Build/Products/Debug-iphonesimulator -F/Users/steve/Desktop/MyProject/YelpAPI/Frameworks -fno-objc-arc --serialize-diagnostics /Users/steve/Library/Developer/Xcode/DerivedData/MyProject-ajtusdfivjqtabgvzfuzqifdjuis/Build/Intermediates/PrecompiledHeaders/MyProject-Prefix-eouuweehlrhtjxdsrgwseamnhnna/MyProject-Prefix.pch.dia -c /Users/steve/Desktop/MyProject/MyProject/MyProject-Prefix.pch -o /Users/steve/Library/Developer/Xcode/DerivedData/MyProject-ajtusdfivjqtabgvzfuzqifdjuis/Build/Intermediates/PrecompiledHeaders/MyProject-Prefix-eouuweehlrhtjxdsrgwseamnhnna/MyProject-Prefix.pch.pth -MMD -MT dependencies -MF /Users/steve/Library/Developer/Xcode/DerivedData/MyProject-ajtusdfivjqtabgvzfuzqifdjuis/Build/Intermediates/PrecompiledHeaders/MyProject-Prefix-eouuweehlrhtjxdsrgwseamnhnna/MyProject-Prefix.pch.d

This is only to be expected. Chances are high that your .pch file contains some definitions that would cause a warning when compiled in non-ARC mode. Most probably the non-arc compiled files will use the precompiled header, too, so the header in the .pch files should be compilable in both ARC and non-ARC mode (after all, the PCH mechanism is semantically equivalent to putting the #imports of the .pch file into each and every .m file).
I would say that this is a bug of XCode if it still gave these warning when all non-ARC compiled files were explicitly exempted from the PCH compilation model. Apparently you can't turn off the usage of pre-compiled headers for single files under XCode (as you can do with MS's VisualC++), so the only advice I can give you is to make the classes in your .pch file compatible for both ARC and non-ARC compilation.

I got the same error you did when attempting to flag two of my .m files with
-fno-objc-arc
, and couldn't find a solution, so I just set the "Objective-C Automatic Reference Counting" variable to "No" and added the
-fobjc-arc
compiler flag to all of the .m files which use ARC. This worked for me.

Related

ASIHTTPRequest compilation error on iPhone - `set`

I am compiling ASIHTTPRequest in a new iPhone project, and getting a major error on compile.
The error is:
clang: error: no such file or directory: 'set'
Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang failed `with exit code 1
Having analysed the compile string, there is only 1 place where 'set' appears, and it is in this line:
set -fno-objc-arc --serialize-diagnostics
So maybe this is failing?
If so, how do I take this line out to make it build?
The full compile string:
ProcessPCH /Users/willmoss26/Library/Developer/Xcode/DerivedData/ArrestsPlotter- bafbkfhslokdxwcjmtzgipqcqgiv/Build/Intermediates/PrecompiledHeaders/ArrestsPlotter-Prefix- asfyhfrzleolpzgggflhpvakdbtg/ArrestsPlotter-Prefix.pch.pth ArrestsPlotter/ArrestsPlotter-Prefix.pch normal i386 objective-c com.apple.compilers.llvm.clang.1_0.compiler
cd /Users/willmoss26/Documents/XCode/ArrestsPlotter
setenv LANG en_US.US-ASCII
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"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x objective-c-header -arch i386 -fmessage-length=0 -std=gnu99 -fobjc-arc -Wno-trigraphs -fpascal-strings -O0 -Wno-missing-field-initializers -Wno-missing-prototypes -Wreturn-type -Wno-implicit-atomic-properties -Wno-receiver-is-weak -Wduplicate-method-match -Wformat -Wno-missing-braces -Wparentheses -Wswitch -Wno-unused-function -Wno-unused-label -Wno-unused-parameter -Wunused-variable -Wunused-value -Wuninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-conversion -Wno-sign-compare -Wno-shorten-64-to-32 -Wpointer-sign -Wno-newline-eof -Wno-selector -Wno-strict-selector-match -Wno-undeclared-selector -Wno-deprecated-implementations -DDEBUG=1 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.1.sdk -fexceptions -fasm-blocks -Wprotocol -Wdeprecated-declarations -mmacosx-version-min=10.6 -g -Wno-sign-conversion -fobjc-abi-version=2 -fobjc-legacy-dispatch "-DIBOutlet=__attribute__((iboutlet))" "-DIBOutletCollection(ClassName)=__attribute__((iboutletcollection(ClassName)))" "-DIBAction=void)__attribute__((ibaction)" -D__IPHONE_OS_VERSION_MIN_REQUIRED=50100 -iquote /Users/willmoss26/Library/Developer/Xcode/DerivedData/ArrestsPlotter-bafbkfhslokdxwcjmtzgipqcqgiv/Build/Intermediates/ArrestsPlotter.build/Debug-iphonesimulator/ArrestsPlotter.build/ArrestsPlotter-generated-files.hmap -I/Users/willmoss26/Library/Developer/Xcode/DerivedData/ArrestsPlotter-bafbkfhslokdxwcjmtzgipqcqgiv/Build/Intermediates/ArrestsPlotter.build/Debug-iphonesimulator/ArrestsPlotter.build/ArrestsPlotter-own-target-headers.hmap -I/Users/willmoss26/Library/Developer/Xcode/DerivedData/ArrestsPlotter-bafbkfhslokdxwcjmtzgipqcqgiv/Build/Intermediates/ArrestsPlotter.build/Debug-iphonesimulator/ArrestsPlotter.build/ArrestsPlotter-all-target-headers.hmap -iquote /Users/willmoss26/Library/Developer/Xcode/DerivedData/ArrestsPlotter-bafbkfhslokdxwcjmtzgipqcqgiv/Build/Intermediates/ArrestsPlotter.build/Debug-iphonesimulator/ArrestsPlotter.build/ArrestsPlotter-project-headers.hmap -I/Users/willmoss26/Library/Developer/Xcode/DerivedData/ArrestsPlotter-bafbkfhslokdxwcjmtzgipqcqgiv/Build/Products/Debug-iphonesimulator/include -I/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include -I/Users/willmoss26/Library/Developer/Xcode/DerivedData/ArrestsPlotter-bafbkfhslokdxwcjmtzgipqcqgiv/Build/Intermediates/ArrestsPlotter.build/Debug-iphonesimulator/ArrestsPlotter.build/DerivedSources/i386 -I/Users/willmoss26/Library/Developer/Xcode/DerivedData/ArrestsPlotter-bafbkfhslokdxwcjmtzgipqcqgiv/Build/Intermediates/ArrestsPlotter.build/Debug-iphonesimulator/ArrestsPlotter.build/DerivedSources -F/Users/willmoss26/Library/Developer/Xcode/DerivedData/ArrestsPlotter-bafbkfhslokdxwcjmtzgipqcqgiv/Build/Products/Debug-iphonesimulator set -fno-objc-arc --serialize-diagnostics /Users/willmoss26/Library/Developer/Xcode/DerivedData/ArrestsPlotter-bafbkfhslokdxwcjmtzgipqcqgiv/Build/Intermediates/PrecompiledHeaders/ArrestsPlotter-Prefix-asfyhfrzleolpzgggflhpvakdbtg/ArrestsPlotter-Prefix.pch.dia -c /Users/willmoss26/Documents/XCode/ArrestsPlotter/ArrestsPlotter/ArrestsPlotter-Prefix.pch -o /Users/willmoss26/Library/Developer/Xcode/DerivedData/ArrestsPlotter-bafbkfhslokdxwcjmtzgipqcqgiv/Build/Intermediates/PrecompiledHeaders/ArrestsPlotter-Prefix-asfyhfrzleolpzgggflhpvakdbtg/ArrestsPlotter-Prefix.pch.pth -MMD -MT dependencies -MF /Users/willmoss26/Library/Developer/Xcode/DerivedData/ArrestsPlotter-bafbkfhslokdxwcjmtzgipqcqgiv/Build/Intermediates/PrecompiledHeaders/ArrestsPlotter-Prefix-asfyhfrzleolpzgggflhpvakdbtg/ArrestsPlotter-Prefix.pch.d
Thanks very much :)
There's no reason for set to be there. People only generally set -fno-objc-arc on a file-by-file basis, so chances are it's a copy and paste error when you were setting this up.
Select the target you are building, go to the Build Phases section, and under Compile Sources, edit the compiler flags to remove set.
You may want to use a different library: ASIHTTPRequest is no longer being supported by its creator.
NSURLRequest/NSURLConnection are a lot easier to work with in iOS5, so that is one option. I have recently converted a few projects from using ASIHTTPRequest over to using the new NSURL stuff and can attest to the improvements there.
AFNetworking is a new framework gaining in popularity. I'm currently building a project using it and like it a lot; it takes all the work out of consuming JSON/XML.
Ahhh I answered it myself.... nevermind!
The answer is, I had added 'set' to the compile line for a whole load of sources, instead of just adding the appropriate flag. So the compiler was asked, 'what is set'?
Stuuupid :p

iPhone app compilation failed for simulator: llvm-gcc-4.2 failed with exit code 255

My teammate compiled the application with a new branch of Restkit, and it works fine on his machine. After I pulled the new code, I was unable to run it in simulator mode anymore.
There is some error with the vendor code in the restkit.
I tried e solutions discussed in other qns: changing the architecture, valid architecture, compiler (to llvm 2.1), and a whole host of other settings.
But nothing seems to work. Any advise would be greatly appreciated.
The only key difference in our configuration is that he has installed ios5 on his xcode, while i do not have it
CompileC /Users/mingyeow/Library/Developer/Xcode/DerivedData/onethingaday-espywbsoeffyaedhqzaoogguqyci/Build/Intermediates/RestKit.build/Debug-iphonesimulator/RestKitJSONParser+NXJSON.build/Objects-normal/armv6/NXJsonParser.o Vendor/NXJSON/NXJsonParser.m normal armv6 objective-c com.apple.compilers.llvmgcc42
cd /Users/mingyeow/tmp/DailyMus.es/RestKit
setenv LANG en_US.US-ASCII
setenv PATH "/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/llvm-gcc-4.2 -x objective-c -arch armv6 -fmessage-length=0 -pipe -std=gnu99 -Wno-trigraphs -fpascal-strings -O0 -Wreturn-type -Wunused-variable -DDEBUG -isysroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk -fexceptions -mmacosx-version-min=10.6 -gdwarf-2 -fobjc-abi-version=2 -fobjc-legacy-dispatch -D__IPHONE_OS_VERSION_MIN_REQUIRED=40300 -iquote /Users/mingyeow/Library/Developer/Xcode/DerivedData/onethingaday-espywbsoeffyaedhqzaoogguqyci/Build/Intermediates/RestKit.build/Debug-iphonesimulator/RestKitJSONParser+NXJSON.build/RestKitJSONParserNXJSON-generated-files.hmap -I/Users/mingyeow/Library/Developer/Xcode/DerivedData/onethingaday-espywbsoeffyaedhqzaoogguqyci/Build/Intermediates/RestKit.build/Debug-iphonesimulator/RestKitJSONParser+NXJSON.build/RestKitJSONParserNXJSON-own-target-headers.hmap -I/Users/mingyeow/Library/Developer/Xcode/DerivedData/onethingaday-espywbsoeffyaedhqzaoogguqyci/Build/Intermediates/RestKit.build/Debug-iphonesimulator/RestKitJSONParser+NXJSON.build/RestKitJSONParserNXJSON-all-target-headers.hmap -iquote /Users/mingyeow/Library/Developer/Xcode/DerivedData/onethingaday-espywbsoeffyaedhqzaoogguqyci/Build/Intermediates/RestKit.build/Debug-iphonesimulator/RestKitJSONParser+NXJSON.build/RestKitJSONParserNXJSON-project-headers.hmap -I/Users/mingyeow/Library/Developer/Xcode/DerivedData/onethingaday-espywbsoeffyaedhqzaoogguqyci/Build/Products/Debug-iphonesimulator/include -IVendor/NSJSON -I/Users/mingyeow/Library/Developer/Xcode/DerivedData/onethingaday-espywbsoeffyaedhqzaoogguqyci/Build/Intermediates/RestKit.build/Debug-iphonesimulator/RestKitJSONParser+NXJSON.build/DerivedSources/armv6 -I/Users/mingyeow/Library/Developer/Xcode/DerivedData/onethingaday-espywbsoeffyaedhqzaoogguqyci/Build/Intermediates/RestKit.build/Debug-iphonesimulator/RestKitJSONParser+NXJSON.build/DerivedSources -F/Users/mingyeow/Library/Developer/Xcode/DerivedData/onethingaday-espywbsoeffyaedhqzaoogguqyci/Build/Products/Debug-iphonesimulator -c /Users/mingyeow/tmp/DailyMus.es/RestKit/Vendor/NXJSON/NXJsonParser.m -o /Users/mingyeow/Library/Developer/Xcode/DerivedData/onethingaday-espywbsoeffyaedhqzaoogguqyci/Build/Intermediates/RestKit.build/Debug-iphonesimulator/RestKitJSONParser+NXJSON.build/Objects-normal/armv6/NXJsonParser.o
Command /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/
bin/llvm-gcc-4.2 failed with exit code 255
Exit code 255 means a file was not found, usually an executable like ld is missing from /Developer/usr/bin. To find out which file it cannot find open up a Terminal, and manually run these 4 commands (from the error log):
cd /Users/mingyeow/tmp/DailyMus.es/RestKit
export LANG=en_US.US-ASCII
export PATH="/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/llvm-gcc-4.2 -x objective-c -arch armv6 -fmessage-length=0 -pipe -std=gnu99 -Wno-trigraphs -fpascal-strings -O0 -Wreturn-type -Wunused-variable -DDEBUG -isysroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk -fexceptions -mmacosx-version-min=10.6 -gdwarf-2 -fobjc-abi-version=2 -fobjc-legacy-dispatch -D__IPHONE_OS_VERSION_MIN_REQUIRED=40300 -iquote /Users/mingyeow/Library/Developer/Xcode/DerivedData/onethingaday-espywbsoeffyaedhqzaoogguqyci/Build/Intermediates/RestKit.build/Debug-iphonesimulator/RestKitJSONParser+NXJSON.build/RestKitJSONParserNXJSON-generated-files.hmap -I/Users/mingyeow/Library/Developer/Xcode/DerivedData/onethingaday-espywbsoeffyaedhqzaoogguqyci/Build/Intermediates/RestKit.build/Debug-iphonesimulator/RestKitJSONParser+NXJSON.build/RestKitJSONParserNXJSON-own-target-headers.hmap -I/Users/mingyeow/Library/Developer/Xcode/DerivedData/onethingaday-espywbsoeffyaedhqzaoogguqyci/Build/Intermediates/RestKit.build/Debug-iphonesimulator/RestKitJSONParser+NXJSON.build/RestKitJSONParserNXJSON-all-target-headers.hmap -iquote /Users/mingyeow/Library/Developer/Xcode/DerivedData/onethingaday-espywbsoeffyaedhqzaoogguqyci/Build/Intermediates/RestKit.build/Debug-iphonesimulator/RestKitJSONParser+NXJSON.build/RestKitJSONParserNXJSON-project-headers.hmap -I/Users/mingyeow/Library/Developer/Xcode/DerivedData/onethingaday-espywbsoeffyaedhqzaoogguqyci/Build/Products/Debug-iphonesimulator/include -IVendor/NSJSON -I/Users/mingyeow/Library/Developer/Xcode/DerivedData/onethingaday-espywbsoeffyaedhqzaoogguqyci/Build/Intermediates/RestKit.build/Debug-iphonesimulator/RestKitJSONParser+NXJSON.build/DerivedSources/armv6 -I/Users/mingyeow/Library/Developer/Xcode/DerivedData/onethingaday-espywbsoeffyaedhqzaoogguqyci/Build/Intermediates/RestKit.build/Debug-iphonesimulator/RestKitJSONParser+NXJSON.build/DerivedSources -F/Users/mingyeow/Library/Developer/Xcode/DerivedData/onethingaday-espywbsoeffyaedhqzaoogguqyci/Build/Products/Debug-iphonesimulator -c /Users/mingyeow/tmp/DailyMus.es/RestKit/Vendor/NXJSON/NXJsonParser.m -o /Users/mingyeow/Library/Developer/Xcode/DerivedData/onethingaday-espywbsoeffyaedhqzaoogguqyci/Build/Intermediates/RestKit.build/Debug-iphonesimulator/RestKitJSONParser+NXJSON.build/Objects-normal/armv6/NXJsonParser.o
Then it will tell you the exact file it is looking for that is missing.
Im guessing something is missing from /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin, if you recently upgraded to xcode 4.2 and still have xcode 4.1 installed I suggest copying everything from /Developer-4.1/Platforms/iPhoneSimulator.platform/Developer/usr/bin/ to /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/ but without overwriting/replacing anything, just copy everything that is in the 4.1 dir but not in the /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin.
According to this article this is how to fix a missing execvp:
Check out your build configuration. The Architectures probably have an inherited $(ARCHS_…) value which can fire a build error:
Navigate to Build Settings in Xcode and check out values in the Architectures group.
Remove “VALID ARCH” entry from Architectures field to reset settings. Use $(ARCHS_STANDARD_32_BIT), or armv6, armv7 values as you wish. $(ARCHS_STANDARD_32_BIT) should show armv6 armv7.
Repeat these steps at your dependent projects.

iPhone Xcode RELEASE configuration build error - yet DEBUG works OK

I am a fairly new iPhone developer. I have four apps in final testing stages and working to get them signed and ready for the app store.
I duplicated the RELEASE configuration, and when I try to build using it I get this error:
Precompile myappname_Prefix.pch<br>
Command /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc-4.2 failed with exit code 1<br>
I do not get errors with the DEBUG configuration.
Any help would be appreciated.
I realize I may have some other issues here but a direction from one of you awsome developers would be great!
Here's the full text from Xcode Build Results:
ProcessPCH /var/folders/kP/kPjI69l+HP0oTFOqT+IHLE+++TI/-Caches-/com.apple.Xcode.501/SharedPrecompiledHeaders/myappname_Pro_Prefix-aozmnrcmoaunqpberswshlqzvjyv/myappname_Pro_Prefix.pch.gch myappname_Pro_Prefix.pch normal armv7 objective-c com.apple.compilers.gcc.4_2
cd "/Users/hanaan/Documents/iPhone dev/myappname Pro"
setenv LANG en_US.US-ASCII
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 -x objective-c-header -arch armv7 -fmessage-length=0 -pipe -std=c99 -Wno-trigraphs -fpascal-strings -Os -mdynamic-no-pic -Wreturn-type -Wunused-variable -DPRO -isysroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.0.sdk -fvisibility=hidden -gdwarf-2 -mthumb -miphoneos-version-min=4.0 -iquote "/Users/hanaan/Documents/iPhone dev/myappname Pro/build/myappname.build/iphoneDistribution-iphoneos/myappname.build/myappname Pro-generated-files.hmap" "-I/Users/hanaan/Documents/iPhone dev/myappname Pro/build/myappname.build/iphoneDistribution-iphoneos/myappname.build/myappname Pro-own-target-headers.hmap" "-I/Users/hanaan/Documents/iPhone dev/myappname Pro/build/myappname.build/iphoneDistribution-iphoneos/myappname.build/myappname Pro-all-target-headers.hmap" -iquote "/Users/hanaan/Documents/iPhone dev/myappname Pro/build/myappname.build/iphoneDistribution-iphoneos/myappname.build/myappname Pro-project-headers.hmap" "-F/Users/hanaan/Documents/iPhone dev/myappname Pro/build/iphoneDistribution-iphoneos" "-I/Users/hanaan/Documents/iPhone dev/myappname Pro/build/iphoneDistribution-iphoneos/include" "-I/Users/hanaan/Documents/iPhone dev/myappname Pro/build/myappname.build/iphoneDistribution-iphoneos/myappname.build/DerivedSources/armv7" "-I/Users/hanaan/Documents/iPhone dev/myappname Pro/build/myappname.build/iphoneDistribution-iphoneos/myappname.build/DerivedSources" -DNS_BLOCK_ASSERTIONS=1 -c "/Users/hanaan/Documents/iPhone dev/myappname Pro/myappname_Pro_Prefix.pch" -o /var/folders/kP/kPjI69l+HP0oTFOqT+IHLE+++TI/-Caches-/com.apple.Xcode.501/SharedPrecompiledHeaders/myappname_Pro_Prefix-aozmnrcmoaunqpberswshlqzvjyv/myappname_Pro_Prefix.pch.gch
arm-apple-darwin10-gcc-4.2.1: /Users/hanaan/Documents/iPhone dev/myappname Pro/myappname_Pro_Prefix.pch: No such file or directory
arm-apple-darwin10-gcc-4.2.1: warning: '-x objective-c-header' after last input file has no effect
arm-apple-darwin10-gcc-4.2.1: no input files
Command /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc-4.2 failed with exit code 1
OK, found the problem.
I have renamed some files due to a spelling error and had the file name correct in the DEBUG configuration build plist, but not in the Release one...
It's complaining that it can't find the myappname_Pro_Prefix.pch file which contains the headers for the major frameworks.
Make sure the pch file is added to the release target (you may have more than one target) by getting info on it and checking its "targets" tag. Check the path to the file in the "general" tab to make sure there is no weirdness there.
Clear the Xcode cache with Xcode>Empty Caches.... Then clean all targets.

Distribution build of Finch demo ends with GCC error

thanks to zoul for sharing his openal avaudioplayer alternative!! its exactly what i needed,
heres my problem.. i cant build a distribution build w/o getting
general gcc-4.2 failed with error code 1,
i built my code within the finch demo project and figured it might be
something i did.
so i re-downloaded demo... duplicated release, renamed distribution
and same thing...
know what im missing?
thanks!!
built clean finch demo in device 3.0 distribution,
it works for device debug so i think codesigning is ok
-
here is the error code:
ProcessPCH /var/folders/vB/vBGLPzEOHIaZaBe67EuRZU+++TI/-Caches-/com.apple.Xcode.501/SharedPrecompiledHeaders/Demo_Prefix-dhjhmgdrpwujnmakgukffcldlmim/Demo_Prefix.pch.gch Demo_Prefix.pch normal armv6 objective-c com.apple.compilers.gcc.4_2
cd /Users/giles73/Downloads/zoul-Finch-a97b909-1/Demo
setenv LANG en_US.US-ASCII
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 -x objective-c-header -arch armv6 -fmessage-length=0 -pipe -std=c99 -Wno-trigraphs -fpascal-strings -Os -mdynamic-no-pic -Wreturn-type -Wunused-variable -isysroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.1.3.sdk -fvisibility=hidden -gdwarf-2 -mthumb -miphoneos-version-min=3.1.3 -iquote /Users/giles73/Downloads/zoul-Finch-a97b909-1/Demo/build/Demo.build/Release-iphoneos/Demo.build/Demo-generated-files.hmap -I/Users/giles73/Downloads/zoul-Finch-a97b909-1/Demo/build/Demo.build/Release-iphoneos/Demo.build/Demo-own-target-headers.hmap -I/Users/giles73/Downloads/zoul-Finch-a97b909-1/Demo/build/Demo.build/Release-iphoneos/Demo.build/Demo-all-target-headers.hmap -iquote /Users/giles73/Downloads/zoul-Finch-a97b909-1/Demo/build/Demo.build/Release-iphoneos/Demo.build/Demo-project-headers.hmap -F/Users/giles73/Downloads/zoul-Finch-a97b909-1/Demo/build/Release-iphoneos -I/Users/giles73/Downloads/zoul-Finch-a97b909-1/Demo/build/Release-iphoneos/include -I/Users/giles73/Downloads/zoul-Finch-a97b909-1/Demo/build/Demo.build/Release-iphoneos/Demo.build/DerivedSources/armv6 -I/Users/giles73/Downloads/zoul-Finch-a97b909-1/Demo/build/Demo.build/Release-iphoneos/Demo.build/DerivedSources -c /Users/giles73/Downloads/zoul-Finch-a97b909-1/Demo/Demo_Prefix.pch -o /var/folders/vB/vBGLPzEOHIaZaBe67EuRZU+++TI/-Caches-/com.apple.Xcode.501/SharedPrecompiledHeaders/Demo_Prefix-dhjhmgdrpwujnmakgukffcldlmim/Demo_Prefix.pch.gch
arm-apple-darwin10-gcc-4.2.1: /Users/giles73/Downloads/zoul-Finch-a97b909-1/Demo/Demo_Prefix.pch: No such file or directory
arm-apple-darwin10-gcc-4.2.1: warning: '-x objective-c-header' after last input file has no effect
arm-apple-darwin10-gcc-4.2.1: no input files
Command /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc-4.2 failed with exit code 1
Aha, my fault, that’s a bug. Wrong prefix header setting in the Release build mode. Fixed, thank you. To fix your project: right-click your target, select Get Info, switch to the Build tab, set Configuration to All Configurations, search for Prefix Header and set it to prefix.pch.

gcc-4.2 failed with exit code 1 in Xcode

I'm working with Xcode 3.2.3 and iOS 4.0.1 and I have downloaded an open source iPhone game to learn from but without editing anything I tried to run it in the simulator and it throws this error message:
ProcessPCH /var/folders/-r/-r6hd0CEEASnoGYBU9KSlk+++TI/-Caches-/com.apple.Xcode.501/SharedPrecompiledHeaders/catchcat_Prefix-crjsognppahnfgdfvinmsqvdioie/catchcat_Prefix.pch.gch
catchcat_Prefix.pch normal i386
objective-c
com.apple.compilers.gcc.4_2
cd "/Users/ryanpoolos/Desktop/Open Source
iPhone/lifengtian-catchcat-f3d5f20"
setenv LANG en_US.US-ASCII
setenv PATH "/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc-4.2
-x objective-c-header -arch i386 -fmessage-length=0 -pipe -std=c99 -Wno-trigraphs -fpascal-strings -fasm-blocks -O0 -Wreturn-type -Wunused-variable -D__IPHONE_OS_VERSION_MIN_REQUIRED=30200 -isysroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.2.sdk
-fvisibility=hidden -mmacosx-version-min=10.5 -gdwarf-2 -fobjc-abi-version=2 -fobjc-legacy-dispatch -iquote "/Users/ryanpoolos/Desktop/Open Source
iPhone/lifengtian-catchcat-f3d5f20/build/catchcat.build/Debug-iphonesimulator/catchcat.build/catchcat-generated-files.hmap"
"-I/Users/ryanpoolos/Desktop/Open
Source
iPhone/lifengtian-catchcat-f3d5f20/build/catchcat.build/Debug-iphonesimulator/catchcat.build/catchcat-own-target-headers.hmap"
"-I/Users/ryanpoolos/Desktop/Open
Source
iPhone/lifengtian-catchcat-f3d5f20/build/catchcat.build/Debug-iphonesimulator/catchcat.build/catchcat-all-target-headers.hmap"
-iquote "/Users/ryanpoolos/Desktop/Open Source
iPhone/lifengtian-catchcat-f3d5f20/build/catchcat.build/Debug-iphonesimulator/catchcat.build/catchcat-project-headers.hmap"
"-F/Users/ryanpoolos/Desktop/Open
Source
iPhone/lifengtian-catchcat-f3d5f20/build/Debug-iphonesimulator"
"-I/Users/ryanpoolos/Desktop/Open
Source
iPhone/lifengtian-catchcat-f3d5f20/build/Debug-iphonesimulator/include"
"-I/Users/ryanpoolos/Desktop/Open
Source
iPhone/lifengtian-catchcat-f3d5f20/build/catchcat.build/Debug-iphonesimulator/catchcat.build/DerivedSources/i386"
"-I/Users/ryanpoolos/Desktop/Open
Source
iPhone/lifengtian-catchcat-f3d5f20/build/catchcat.build/Debug-iphonesimulator/catchcat.build/DerivedSources"
-c "/Users/ryanpoolos/Desktop/Open Source
iPhone/lifengtian-catchcat-f3d5f20/catchcat_Prefix.pch" -o /var/folders/-r/-r6hd0CEEASnoGYBU9KSlk+++TI/-Caches-/com.apple.Xcode.501/SharedPrecompiledHeaders/catchcat_Prefix-crjsognppahnfgdfvinmsqvdioie/catchcat_Prefix.pch.gch
i686-apple-darwin10-gcc-4.2.1: /Users/ryanpoolos/Desktop/Open Source
iPhone/lifengtian-catchcat-f3d5f20/catchcat_Prefix.pch: No such file or directory
i686-apple-darwin10-gcc-4.2.1: warning: '-x objective-c-header' after
last input file has no effect
i686-apple-darwin10-gcc-4.2.1: no input files
Command /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc-4.2
failed with exit code 1
Help me out anyone?
Sounds like something somewhere isn't properly quoting the spaces in your path. Try renaming OPen Source iPhone to OpenSourceIPhone or something.
Silly, I know, but occasionally the unixisms creep through.
This can happen if you have an empty line in any of configuration lists of the project. For example in user defines or include paths.