Here’s what you need to do to install g++ and gcc on Mac OS X 10.8.
- Install XCode 4.4 from App Store.
- Start XCode.
- 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
Did this tip help you? Let me know in the comments!