New To Mac-Forums?

Welcome to our community! Join the discussion today by registering your FREE account. If you have any problems with the registration process, please contact us!

Get your questions answered by community gurus Advice and insight from world-class Apple enthusiasts Exclusive access to members-only contests, giveaways and deals

Join today!

 
Start a Discussion
 

Mac-Forums Brief

Subscribe to Mac-Forums Brief to receive special offers from Mac-Forums partners and sponsors

Join the conversation RSS
OS X - Operating System General OS operation information and support

Xcode Failed to Install G++


Post Reply New Thread Subscribe

 
Thread Tools
Shoal

 
Member Since: Jan 19, 2012
Posts: 14
Shoal is on a distinguished road

Shoal is offline
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!
QUOTE Thanks
vansmith

 
vansmith's Avatar
 
Member Since: Oct 19, 2008
Location: Toronto
Posts: 18,229
vansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond repute
Mac Specs: 2012 13" MBP (2.5 i5, 8GB)

vansmith is offline
It should be there but you wouldn't be the first person missing the links. Execute the following commands to set the links:
Code:
sudo ln -s /Developer/usr/bin/llvm-g++-4.2 /usr/bin/g++
Code:
sudo ln -s /Developer/usr/bin/llvm-gcc-4.2 /usr/bin/gcc

Important Links: Community Guidelines : Use the reputation system if you've been helped.
M-F Blog :: Write for the blog
Writing a Quality Post
QUOTE Thanks
Shoal

 
Member Since: Jan 19, 2012
Posts: 14
Shoal is on a distinguished road

Shoal is offline
It says "udo" command not found.
QUOTE Thanks
vansmith

 
vansmith's Avatar
 
Member Since: Oct 19, 2008
Location: Toronto
Posts: 18,229
vansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond repute
Mac Specs: 2012 13" MBP (2.5 i5, 8GB)

vansmith is offline
Oops, that was my inability to copy and paste.

Commands fixed.

Important Links: Community Guidelines : Use the reputation system if you've been helped.
M-F Blog :: Write for the blog
Writing a Quality Post
QUOTE Thanks
Shoal

 
Member Since: Jan 19, 2012
Posts: 14
Shoal is on a distinguished road

Shoal is offline
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.
QUOTE Thanks
vansmith

 
vansmith's Avatar
 
Member Since: Oct 19, 2008
Location: Toronto
Posts: 18,229
vansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond repute
Mac Specs: 2012 13" MBP (2.5 i5, 8GB)

vansmith is offline
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?
Code:
echo $PATH

Important Links: Community Guidelines : Use the reputation system if you've been helped.
M-F Blog :: Write for the blog
Writing a Quality Post
QUOTE Thanks
Shoal

 
Member Since: Jan 19, 2012
Posts: 14
Shoal is on a distinguished road

Shoal is offline
It returns:

Code:
/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin
QUOTE Thanks
vansmith

 
vansmith's Avatar
 
Member Since: Oct 19, 2008
Location: Toronto
Posts: 18,229
vansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond repute
Mac Specs: 2012 13" MBP (2.5 i5, 8GB)

vansmith is offline
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/?

Important Links: Community Guidelines : Use the reputation system if you've been helped.
M-F Blog :: Write for the blog
Writing a Quality Post
QUOTE Thanks
Shoal

 
Member Since: Jan 19, 2012
Posts: 14
Shoal is on a distinguished road

Shoal is offline
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...)
QUOTE Thanks
vansmith

 
vansmith's Avatar
 
Member Since: Oct 19, 2008
Location: Toronto
Posts: 18,229
vansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond repute
Mac Specs: 2012 13" MBP (2.5 i5, 8GB)

vansmith is offline
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).

Important Links: Community Guidelines : Use the reputation system if you've been helped.
M-F Blog :: Write for the blog
Writing a Quality Post
QUOTE Thanks
Shoal

 
Member Since: Jan 19, 2012
Posts: 14
Shoal is on a distinguished road

Shoal is offline
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?
QUOTE Thanks
vansmith

 
vansmith's Avatar
 
Member Since: Oct 19, 2008
Location: Toronto
Posts: 18,229
vansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond repute
Mac Specs: 2012 13" MBP (2.5 i5, 8GB)

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

Important Links: Community Guidelines : Use the reputation system if you've been helped.
M-F Blog :: Write for the blog
Writing a Quality Post
QUOTE Thanks
Shoal

 
Member Since: Jan 19, 2012
Posts: 14
Shoal is on a distinguished road

Shoal is offline
Works just fine now, thanks a lot for all your help!
QUOTE Thanks

Post Reply New Thread Subscribe


« can't boot cloned drive | Need to "wipe" personal info from MacBook »
Thread Tools

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread
Thread Starter
Forum
Replies
Last Post
Snow Leopard Install Failed on my MacBook Pro - How I fixed it! merlin_vi OS X - Operating System 26 04-02-2011 03:02 PM
Missing disk space after failed Boot Camp install kahlil88 OS X - Operating System 4 10-04-2010 01:40 AM
Install Failed Message - Snow Leopard on a MBP jhowton OS X - Operating System 8 09-07-2010 07:06 PM
Is full install of XCode necessary? AmiInDresden OS X - Apps and Games 3 09-03-2010 07:26 PM
How To Install Apple X11 From Tiger Install Disks mac57 OS X - Apps and Games 18 06-03-2006 07:11 PM

All times are GMT -4. The time now is 12:52 AM.

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

Welcome to Mac-Forums.com

Create your username to jump into the discussion!

New members like you have made this community the ultimate source for your Mac since 2003!


(4 digit year)

Already a member?