I updated to OS X Lion today, and I don't seem to have a copy of gcc any more. Did this happen to anyone else? Does anyone know why this would happen?
I was mighty pissed when I found out that the OS X Lion upgrade wiped out my entire development tool-chain. However, with help from a friend, I discovered that the tool-chain had instead been moved into the
/Developer/usr/bin/ folder on disk. For my immediate need, I only had to make
g++ available on path, so I created symlinks to
/Developer/usr/bin/g++-4.2 inside the
/usr/bin/ folder. However, I imagine the correct approach would be re-install XCode to fix the issue.
Just installed Xcode 4.3 on Lion from the app store, had the same issue with gcc, etc not installed. Fumbled around until I did the following:
in Xcode: Preferences --> Downloads With "Components" selected, you will see a list of downloadable components.
Look for Command Line Tools, and click on install. You will be prompted for your Apple Developer userid and password. After successfully authenticating, the command line tools component downloads and installs a bunch of goodness, including gcc.
Download the new Xcode from the App Store and run Install XCode. It's now free, not $4.99.
You can just put /Developer/usr/bin in your $PATH and everything is fine:
I followed these steps and was able to get GCC working again.
- Open the App Store.
- Search for "XCode".
- Search the whole page for any kind of “Buy” or “Download” or “Install” button.
- Ha ha. There isn’t one. Click on the button that says “Free”. It will turn into a button that says “Download”.
- Click that.
- Wait for it to download and install. Now the App Store will claim that you have installed Xcode. Congratulations!
- But you haven’t.
- Open Finder and go to your Applications.
- Find the “Install Xcode” application. Not joking.
- Run it.
I had this issue too, where even after I install XCode4, there was no gcc in my path. But it turns out my install was just borked. I reran the XCode installer and now /usr/bin/gcc is a symlink to /usr/llvm-gcc-4.2/bin/llvm-gcc-4.2 as it should be.
edit: secoif's comment was correct. Just reinstall XCode.
New installations of Xcode (versions 4.2 and up) through the App Store do not ship with gcc-4.2. You can download and install Xcode 4.1 through the Apple Developer Central. Free registration required.
protected by Community♦ Feb 27 '12 at 15:12
Thank you for your interest in this question.
Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).
Would you like to answer one of these unanswered questions instead?