Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where is gcc on OSX? I have installed Xcode already

Tags:

xcode

macos

gcc

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

like image 402
OscarRyz Avatar asked Apr 21 '10 19:04

OscarRyz


People also ask

Where is gcc installed on Mac?

The gcc application will be installed by default in /usr/local/bin.

Where is gcc compiler located?

You need to use the which command to locate c compiler binary called gcc. Usually, it is installed in /usr/bin directory.

Is gcc pre installed in Mac?

Often times, you need c or gcc compiler to compile open source projects in Mac OS X. The problem is Mac OS X doesn't install the gcc compiler by default.

How do I know if gcc compiler is installed?

In the Command Prompt window type “gcc” and hit enter. If the output says something like “gcc: fatal error: no input files”, that is good, and you pass the test.


2 Answers

As of version 4.3.1, XCode is now an application and the command line tools are now available through the Preferences (this is documented in the App Store for XCode under 'What's New in Version 4.3.1' if you click 'More...'). After installing XCode, open it, open the Preferences and click on the Download tab. Click on 'install' for the 'Command Line Tools' and then sign in with your computer's password. The code will then be downloaded and installed.

like image 56
Bob Swerdlow Avatar answered Oct 21 '22 10:10

Bob Swerdlow


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...

like image 39
Brian Postow Avatar answered Oct 21 '22 09:10

Brian Postow