Setting up lab images for this semester, I needed to compile source code for the expat XML tool, and discovered to my annoyance that Lion doesn’t include a C compiler. A quick Google suggested installing Xcode from the Mac App Store. Did this, and still no joy.
Turns out that as of Xcode 4.3.2, command line compilers are no longer installed by default. To fix this:
- Download and run the Xcode app from the MAS.
- Open Xcode’s prefs, and click Downloads.
- Find the Command Line Tools entry and click Install (it’s 180MB at this time, and you’ll be required to authenticate).
- When it’s finished, switch to Terminal and issue the command gcc -v. If you get anything other than “-bash: gcc: command not found”, win!