Moved to a new Mac and now GCC is missing, what to do?

1

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 ?

Snow_Mac

Posted 2012-01-27T20:25:18.073

Reputation: 422

What version of Mac OS X and Xcode? – Daniel Beck – 2012-01-27T20:33:43.837

Lion and the latest version of xCode – Snow_Mac – 2012-02-01T03:02:19.000

Answers

1

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.

Daniel Beck

Posted 2012-01-27T20:25:18.073

Reputation: 98 421

1How do I do that? – Snow_Mac – 2012-02-01T03:01:41.700

What specifically? – Daniel Beck – 2012-02-01T08:24:44.173

3

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.

Brett

Posted 2012-01-27T20:25:18.073

Reputation: 336

0

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.

afrazier

Posted 2012-01-27T20:25:18.073

Reputation: 21 316

gcc is a symlink to llvm-gcc, and should still be available. – Daniel Beck – 2012-01-27T20:56:17.400

I need GCC, not clang or anything else. How can I get this on Mac? – Snow_Mac – 2012-01-30T20:02:47.890

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 – 2012-01-30T21:18:38.700

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 – 2012-01-31T05:06:38.240