Getting GCC for OSX with Developer Tools Installed

I want to get started with C ++ 0x. I see that GCC 4.7 has enough functionality. I already have Xcode 3.2 installed in / Developer

I downloaded: http://fileboar.com/gcc/snapshots/LATEST-4.7/gcc-4.7-20110528.tar.bz2

Is there any way to compile this in / opt / gcc -4.7? How can I then work with my path, so I can compile with GCC 4.7 from the command line, but does OSX use the version it needs?

+3
source share
1 answer

OSX does not require gcc to run - developer tools are optional. Therefore, you only need to select gcc when compiling. In Xcode, you explicitly chose gcc and make Makefiles, you can set $ (CC) or similarly the full path.

Alternatively rename gcc-4.7 gcc to gcc-4.7 and use this, so gcc is always Apple.

To simplify the use of multiple C ++ compilers, I use macports (either fink or homebrew), which will compile the compilers with the correct fixes, as well as a port selection command to switch between C ++ compilers

0
source

All Articles