Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have a new Macbook. I bought it, use time machine to move to it, and it copied everything and xCode runs fine, but when I go to the terminal and type gcc it says command not found.

How do I get GCC ?

share|improve this question
    
What version of Mac OS X and Xcode? –  Daniel Beck Jan 27 '12 at 20:33
    
Lion and the latest version of xCode –  Snow_Mac Feb 1 '12 at 3:02

3 Answers 3

up vote 1 down vote accepted

gcc is in /Developer/usr/bin and /usr/bin. Check these directories and the value of your PATH environment variable, and add to it as needed.

share|improve this answer
1  
How do I do that? –  Snow_Mac Feb 1 '12 at 3:01
    
What specifically? –  Daniel Beck Feb 1 '12 at 8:24

With the latest Xcode, you first need to "Install Command Line Tools." Open XCode. Under the XCode tab, open Preferences, click on the Download panel, and click the install button next to CLI Tools to manually download the XCode CLI Tools.

Once you do that, gcc will be in /usr/bin.

share|improve this answer

I think the ultimate answer is: Get used to clang.

According to this discussion at Ars Technica and this email from the Glascow Haskell Compiler mailing list, gcc is no longer distributed with Xcode 4.2 and clang is the new default, with llvm-gcc provided so that developers can port to clang.

You might also find answers to this StackOverflow question useful.

share|improve this answer
    
gcc is a symlink to llvm-gcc, and should still be available. –  Daniel Beck Jan 27 '12 at 20:56
    
I need GCC, not clang or anything else. How can I get this on Mac? –  Snow_Mac Jan 30 '12 at 20:02
    
If you need real GCC, I think you'll have to install from MacPorts or similar. If you're writing Mac software, Apple's already told you it's on the way out as far as they're concerned. –  afrazier Jan 30 '12 at 21:18
    
I'm writing software that will be compiled and tested on Linux environments but I need GCC to compile and test within my Local Machine. –  Snow_Mac Jan 31 '12 at 5:06

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.