On Nov 25, 2012, at 23:54 , Stephen Kay <
email@hidden> wrote:
3.2 Period. I guess that would be 3.2.0. Is there something ambiguous about
that? It's the version that installs by default with my 10.6 installer disk.
No, that's not ambiguous. Generally you'd want to use the highest 3.2.x available, since the differences are mostly bug fixes, but there are occasional boundaries that are more significant. For example, do *not* go past 3.2.5 -- 3.2.6 was exactly the same as 3.2.5 but dropped support for something you really want. (Sorry, memory fails me, it's been a while now. It dropped an SDK, or PowerPC support, something major like that.) It's also possible that the default GCC changed at one or more of the minor versions.
This is not a hack, as far as I understand it. When I first tried to compile
the code, I was told with an error that " GCC 4.2 is not compatible with the
Mac OS X 10.4 SDK "
After researching this, I saw this thread:
http://stackoverflow.com/questions/1165361/setting-gcc-4-2-as-the-default-co
mpiler-on-mac-os-x-leopard
Well, the trouble is you can't trust anything you read on
stackoverflow.com. It's not so much a question of the information being wrong, it's more a case of TMI: you can't tell the difference between correct answers, formerly-correct-but-now-useless answers, and utter garbage.
While this talked about setting GCC 4.2 as the default compiler, for some
reason I had to go the opposite direction, and set GCC 4.0 as the default
compiler. I agree that /usr/bin was a misdirection from this thread. It only
worked after I modified /Developer/usr/bin.
That discussion was about command line compilation. It doesn't really apply to compilations done within Xcode. It happened to get you to the right compiler because the structure of the the tools inside /Developer is much the same as the structure in the normal Unix location.
If there is some other way to force my projects to use GCC 4.0, I could not
find it. But this seems to have worked.
IIRC (again I apologize that I don't remember for sure) you simply choose the desired GCC version in the build settings. The choice of compiler versions available to you depends on which Xcode version you're using.
In Xcode 4, it's in the Build Options section of the build settings, right above the debug info format, as it happens. I think it's just the same in the Xcode 3 build settings.