tags:

views:

117

answers:

5

I have installed Xcode from the Tool cd, I thought that would let me use gcc from the command line but I can't find it.

What am I missing

EDIT

When I wrote I can't find it I meant "I look for it using which gcc"

If gcc would have been in the PATH in first place, which would have find it.

Since gcc is not in the PATH ( that's what brought me here in first place ) which won't find it!

I think that was obvious but I'm making the note here because it wasn't

+3  A: 

On my Mac $ which gcc displays /usr/bin/gcc.

maerics
Is it possible that `which` returns something if the command doesn't work in first place?
OscarRyz
no, he was just telling you where gcc is SUPPOSED to be. he's saying where gcc is on HIS mac
Brian Postow
@Brian Oh.. then that's a comment, not an answer
OscarRyz
no, it's an answer to your question "Where is gcc on OSX"... the answer is "it should be in /usr/bin"
Brian Postow
@Brian Well, actually the question was "What am I missing" but the obvious answer you've been *"gcc of course!"* so, nevermind. I get your point anyway and it is valid.
OscarRyz
Sorry if I broke protocol, the question title is "Where is gcc on OS X" so I responded; I wasn't trying to offend or make a smart-ass answer. (FWIW I upvoted an other answer with better info.) What are the guidelines for providing an answer vs a comment to the question?
maerics
+3  A: 

Something went wrong with your install.

gcc is installed under /usr/bin with a symlink to gcc-4.2:

cd diciu$ pkgutil --file-info /usr/bin/gcc-4.2 
volume: /
path: /usr/bin/gcc-4.2

pkgid: com.apple.pkg.gcc4.2Leo
pkg-version: 4.2.0.9000000000.1.1249367152
[..]
pkgid: com.apple.pkg.Xcode3.2.1Update
pkg-version: 1.0.1.1249367152
[..]
pkgid: com.apple.pkg.Xcode3.2.1UpdateUNIXDevSupport
pkg-version: 1.0.1.1249367152
[..]
diciu
I didn't know about `pkgutil` - this snippet is definitely a useful one.
awgy
A: 

Is it possible that rather than not having gcc installed, your $PATH variable is messed up? first check if gcc is in /usr/bin manually. Then echo $PATH...

Brian Postow
That' was what I meant with *I can't find it* :P I've updated my post.
OscarRyz
yes, but my point was that gcc notbeing in your path could be caused by your PATH being wrong, OR by gcc not being present...
Brian Postow
+1  A: 

You didn't check the box that says "UNIX Development Support"[1] (or possibly you unchecked it; I can't remember if it's on by default or not) when you did the install, so it didn't install the necessary symlinks and drivers in /usr/bin/.

Reinstall, and make sure to read the descriptions of the configuration options and select the ones that you need.

1: "Optional content to allow command-line development from the boot volume. Installs a duplicate of the GCC compiler and command line tools blah blah blah..."

Stephen Canon
Most likely ... I will reinstall.
OscarRyz
This was it. Now I tried to reinstall but the option is not available :( I create a new question for this: http://stackoverflow.com/questions/2693336/how-to-update-xcode-to-install-unix-development-support
OscarRyz
+1  A: 

The same thing happened to me. Worked for a while then went away. Reinstall and it will be fixed.

You might want to download xcode from Apple while you are at it. Almost guaranteed to be fresher / more up-to-date since xcode is rapidly updated. Current xcode is 3.2.1.10. You need an Apple ID to download, but that also gives you access to the development site. All free....

drewk
+1 @drewk Thanks, I tried do downloaded it from I couldn't pass the firewall ( or the antivirus I don't know ) so today I brought my install CD and this is what happened: http://stackoverflow.com/questions/2693336/how-to-update-xcode-to-install-unix-development-support :(
OscarRyz