tags:

views:

177

answers:

1

Hi everyone,

I'd like to compile my application for version 10.5 and forward. Ever since I upgraded to Snow Leopard and installed the latest XCode, gcc defaults to 10.6. I've tried -isysroot /Developer/SDKs/MacOSX10.5.sdk but that doesn't seem to work. Is there a GCC flag that allows me to set the SDK?

(Incidentally, I changed the gcc symbolic link to point to gcc-4.0 instead of gcc-4.2 and it worked but I thought I could tell the latest GCC to compile for an older SDK).

Thanks, Rui

+3  A: 

In XCode you only need to set the deployment target to OSX 10.5.
For gcc you need to set -mmacosx-version-min=10.5.

Georg Fritzsche
I'm compiling from the command line using make/scons... :(
ruibm
Ah, try `-mmacosx-version-min=10.5` then?
Georg Fritzsche
Lovely, that's exactly it! This way I can still use the latest SDK just tell it to support an older version of Mac OS X. I really couldn't find that in GCC's man page. Thanks!
ruibm