Snow leopards ate my C compiler

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:

  1. Insert the Snow Leopard upgrade CD
  2. Enter the “Optional Installs” folder
  3. 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.

4 comments to Snow leopards ate my C compiler

You must be logged in to post a comment. Don't worry; you needn't register for a new account here. You can log in securely via your Google/Gmail, Yahoo, Facebook, or OpenID account.