tags:

views:

80

answers:

2

Hi,

I installed the latest official iphone sdk and now my personal project is getting the same compiler error in UIView.h as described in this question: http://stackoverflow.com/questions/3098611/syntax-error-before-token

syntax error before '^' token

The solution is apparently to change compiler settings to use GCC 4.2 or LLVM. I've tried using every compiler setting available in Xcode that but am still getting the errors.

Is there something else I should be doing to support the (^) block syntax in my project. The project was building fine with the previous official sdk release (pre OS4)

Another strange detail, I only get the error in debug config, not release. I tried comparing the build settings between debug and release but didnt see any major differences. Where there were differences I tried setting the debug config to use the release config values but still getting those errors.

thanks in advance for any help

A: 

Make sure you have the right configuration or configurations picked when you change compile settings. It's easy to overlook this, for example: picking the Release build when you meant the Debug, or vice versa; or by using other custom build configurations.

Alex Reynolds
I usually pick the build via the main drop down at the top left of the xcode window, then right click the project -> Get Info, Configuration - Active. As far as I know thats the safest way to change settings in Xcode.I just did a double check of my settings against a brand new xcode openGL template project all the same but I have build errors, the fresh project doesnt.Maybe this is a build directory / clean problem?
sodwyer
+1  A: 

ok so I just found my problem.

I was changing build settings by right click -> Get Info on the project but I should have been doing it on the target (which was still using GCC 4.0 even though the project was set to 4.2)

sodwyer