tags:

views:

576

answers:

2

I have installed the developer tools. I can compile code via Xcode and according to the docs /usr/bin/gcc & /usr/bin/cc should point to /usr/bin/gcc-4.0. Neither the symlinks or gcc-4.0 exist on my system (Snow Leopard). All I wish to do is compile some C on the terminal! I'm amazed by how complicated this task is. The command GCC is unsurprisingly returning "gcc: command not found".

Can anyone shed some light on this?

A: 

Did you install the latest Xcode after installing Snow Leopard, or is this the version of Xcode from a previous OS installation?

On my system with a clean Snow Leopard install the default compiler (and the one symlinked from cc and gcc) is gcc-4.2

I do have gcc-4.0 too, although it's not the default.

Alnitak
Yes I installed the latest Xcode after installing Snow Leopard.
Riddian
I'd go for an Xcode reinstall, then. And on my system /usr/bin/gcc-4.* is not a symlink, it's an identical copy of the files from /Developer/usr/bin/
Alnitak
Reinstalled as you suggested and this fixed the problem. I'm not entirely sure why it didn't work the first time around but I'm glad it's all working now!
Riddian
+2  A: 

These binaries should be there after installing xcode. Check your path settings, and if you still don't have these reinstall xcode

ennuikiller
I have managed to find it buried in "/Developer/usr/bin/gcc-4.2". I wonder if "/usr/bin/gcc-4.2" is only a symlink to this and for some reason the XCode install didn't create these. Or perhaps my path settings should point to /Developer/usr/bin/?
Riddian
I'm running snow leopard and gcc-4.2 is not a symlink:Fri Nov 27{stevenhirsch@steven-hirschs-macbook-pro-2}/projects/projects/scripts:-->ls -l /usr/bin/gcc-4.2-rwxr-xr-x 1 root wheel 166128 2009-09-18 13:00 /usr/bin/gcc-4.2
ennuikiller
Thanks very much, proof that something went very wrong somewhere along the lines then!
Riddian