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?
-
Didn't know there was, or was supposed to be, an Xcode installer apart from the app store. Thanks. – Nov 09 '11 at 20:18
7 Answers
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.
- 441
- 1
- 4
- 2
-
3
-
1This answer along with export PATH=${PATH}:/Developer/usr/bin done it for me – Krishnabhadra Apr 12 '12 at 07:34
-
I didn't need to export the path. After install it just worked. Thanks jbm hack – sdjuan Aug 07 '12 at 00:36
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 make, gcc and g++ available on path, so I created symlinks to /Developer/usr/bin/gnumake, /Developer/usr/bin/gcc-4.2, and /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.
- 11,068
- 1
- 21
- 26
Download the new Xcode from the App Store and run Install XCode. It's now free, not $4.99.
- 103
- 4
- 14,636
- 2
- 35
- 44
-
8
-
-
@Zach Well the Dev tools have always been a bit huge, but wouldn't you have to install a new version of Xcode anyway when upgrading the system? – slhck Jul 21 '11 at 06:35
-
1You can still get Xcode for free if you register (again for free) with Apple Developer Connection (http://developer.apple.com). – Scott Jul 21 '11 at 07:04
-
Latest xcode (for lion) seems to remove links to the gcc/make binaries, no idea why. :/ – timoxley Jul 21 '11 at 07:37
-
-
4@Nerian: Download and Install Xcode from AppStore, run "Install Xcode.app" (I missed this step, don't just assume it's installed after installing from the AppStore), then gcc and the other build tools suddenly work. Whoo – timoxley Jul 22 '11 at 12:10
-
-
The download was going to take way too long so I dug out my original OS install CD which comes with the old Xcode installer. Reinstalling from that now. I dont know if it will help you guys but I hope it does ^^ I dont even want Xcode, I just want make and my compilers back .-. – Wolfy87 Jul 22 '11 at 21:31
-
@Wolfy87: From what I understand, Xcode 3.2.x won't work for Lion. You *must* install Xcode 4.1 if you want your compilers back. – fideli Jul 23 '11 at 17:24
-
Well I installed the compilers from the disk. I didn't need Xcode, just the developer tools. – Wolfy87 Jul 24 '11 at 21:25
You can just put /Developer/usr/bin in your $PATH and everything is fine:
export PATH=${PATH}:/Developer/usr/bin
- 161
- 1
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.
- 171
- 1
- 3
-
2If you have Xcode allready installed, run `sudo /Developer/Library/uninstall-devtools --mode=all` to uninstall and then continue from step 8. – bouke Nov 25 '11 at 01:53
-
I uninstalled Xcode & attempted to reinstall, but there was no “Install Xcode” step… however I still don’t have gcc-4.2 in my command line… – Alan H. Mar 06 '12 at 17:14
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.
- 1,117
- 9
- 19
-
Linking to gcc that way doesn't seem to work correctly. See https://gist.github.com/1096750 for me trying to do that to link to gcc/make for use with OSX brew. Download and install from the AppStore as per my other comment. – timoxley Jul 22 '11 at 12:10
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.
- 101
- 2