Installing GCC compiler on OSX Lion

If you’re like me and tried to compile an application from source on your mac, you probably received an error saying you had no C compiler installed. By default OSX Lion does not come with one installed, so we are going to install GCC which will allow us to compile our program.

The most straight forward way to do this:

1. Download and install Apple’s XCode. This should link you to the Mac App store and you can install XCode from there very easily.
2. Now that XCode is installed: Open it up. Click XCode -> Preferences -> Downloads tab -> Click install ‘Command Line Tools’. This will install, among other things, the GCC compiler.

And that is it. You can now compile from source!