Installing g++ and gcc on Mac OS X 10.8 command line

by Dhruba Bandopadhyay on Sun, 29 Jul 2012 22:55:48 +0000

Here’s what you need to do to install g++ and gcc on Mac OS X 10.8.

  1. Install XCode 4.4 from App Store.
  2. Start XCode.
  3. Run XCode > Preferences > Downloads > Components > Command Line Tools > Install.

Once done you should be able to run g++ and gcc from the command line as follows.

tron:~ dhruba$ g++
i686-apple-darwin11-llvm-g++-4.2: no input files

Apparently you can also download the command line package manually from ADC if you prefer (source).

Did this tip help you? Let me know in the comments!

{ 10 comments… read them below or add one }

Ira August 22, 2012 at 00:42

thanks. helped

Reply

Al Watkins September 4, 2012 at 15:50

Timely answer. Thanks.

Reply

F Couceiro September 24, 2012 at 16:03

It worked!
Have been looking for this for some time.
Thanks.

Reply

Alain T. December 13, 2012 at 09:16

Tx a lot !
I didnt find g++, even i had installed XCode.
With this way, it’s ok now !

Reply

Barb. K. January 15, 2013 at 02:06

Thanks. This worked like a charm.

Reply

Elie K. January 16, 2013 at 16:55

Thanks a lot

Reply

DC January 21, 2013 at 07:17

Thanks!

Reply

Feng Yi March 14, 2013 at 02:54

easy to read, thx!

Reply

Antoni April 8, 2013 at 21:20

Perfect. Thank you!

Reply

Ayan May 15, 2013 at 13:43

Yes perfect and small answer

Reply

Leave a Comment

{ 4 trackbacks }

Previous post:

Next post: