Mac Forums

Mac Forums (
-   OS X - Operating System (
-   -   Xcode Failed to Install G++ (

Shoal 03-08-2012 07:58 PM

Xcode Failed to Install G++
Hi all.

Just days ago I installed Xcode from the App Store, but then when I went to the terminal prompt I discovered that the g++ command wasn't there. What gives? Everyone tells me it's supposed to be there, and I need it...

Any help would be greatly appreciated. Thanks!

vansmith 03-08-2012 08:16 PM

It should be there but you wouldn't be the first person missing the links. Execute the following commands to set the links:

sudo ln -s /Developer/usr/bin/llvm-g++-4.2 /usr/bin/g++

sudo ln -s /Developer/usr/bin/llvm-gcc-4.2 /usr/bin/gcc

Shoal 03-08-2012 08:20 PM

It says "udo" command not found.

vansmith 03-08-2012 08:22 PM

Oops, that was my inability to copy and paste. ;)

Commands fixed.

Shoal 03-08-2012 08:37 PM

The line to enter g++ didn't seem to work. It gave me a very grave warning that I was probably about the screw up my machine and then asked me for my password. I entered it, pressed enter, and was unceremoniously returned to the prompt with no sign of success or failure. Entering in the line again says, "Line exists." But here's the thing: it still tells me no g++ command exists.

vansmith 03-08-2012 08:41 PM

When it completes, you don't get a warning or success message. In fact, having nothing printed back is a good sign.

What does the following return?

echo $PATH

Shoal 03-08-2012 08:43 PM

It returns:



vansmith 03-08-2012 09:21 PM

Well, /usr/bin is in your PATH (as it should be) and there is a symlink there called "g++" to the g++ binary installed by Xcode. Do you at least have success executing llvm-g++-4.2 from /Developer/usr/bin/?

Shoal 03-09-2012 05:33 AM

Is "llvm-g++-4.2" a command that needs to be run from a specific directory? (You're dealing with a guy who has lots of DOS experience but virtually zero Unix command line experience. I have to look up how to change directories...)

vansmith 03-09-2012 10:23 AM

cd = change directory.

You can simply execute /Developer/usr/bin/llvm-g++-4.2 or "cd" into /Developer/usr/bin and then type "./llvm-g++-4.2" (without the quotes).

Shoal 03-09-2012 06:03 PM

It says "no such file or directory" when I enter "/Developer/usr/bin/llvm-g++-4.2".

Would it make any difference to say I have Xcode 4.3?

vansmith 03-09-2012 07:21 PM

Yes, absolutely. Xcode 4.3 doesn't install the tools by default. Go to Xcode > Preferences > Downloads > Components > install "Command Line Tools."

Shoal 03-10-2012 08:20 PM

Works just fine now, thanks a lot for all your help! :)

All times are GMT -4. The time now is 02:20 AM.

Powered by vBulletin
Copyright ©2000 - 2015, Jelsoft Enterprises Ltd.