I updated my computer to Mac OS 10.6 (“Snow Leopard”) last week. It worked well. This afternoon, though, I tried to compile a C program for the first time in a long time.
-bash: gcc: command not found
Hmmm….that’s not good. I found gcc living under /Developer/usr/bin, but problems remained:
$ /Developer/usr/bin/gcc -O -o ~/stream stream.c
stream.c:43:20: error: stdio.h: No such file or directory
Digging a bit further, I found that the Snow Leopard upgrade had removed the links to the old (10.5) Developer Tools installation from under /usr but hadn’t installed the new version of the Developer package. The fix was to:
- Insert the Snow Leopard upgrade CD
- Enter the “Optional Installs” folder
- Run Xcode.mpkg
After doing this, I found that I had a /usr/include directory once again, and gcc was able to compile things quite happily.








[...] 20 minutes later I tripped across a post by Brian Pane that set me in the right direction. This could have saved me days of time if I knew [...]
[...] http://www.brianp.net/2009/09/05/snow-leopards-ate-my-c-compiler/ Posted in Mac Cancel Reply [...]
[...] to the following link for providing the solution: “Snow Leopards Ate My C Compiler. Categories: General Tags: Comments (0) Trackbacks (0) Leave a comment [...]
[...] has been said here, here and here, the gcc problems can be solved easily by installing xcode from the Snow Leopard [...]