Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to compile for Mac OS X 10.5

Tags:

xcode

macos

gcc

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

like image 425
rui Avatar asked Nov 11 '09 21:11

rui


People also ask

Is gcc compiler available for Mac?

Done, the gcc version 4.2. 1 is installed on Mac OS X successfully.


1 Answers

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.

like image 128
Georg Fritzsche Avatar answered Oct 16 '22 23:10

Georg Fritzsche