Disclaimer: This page is being maintained mainly for my students. Use these instructions at your own risk. There is no warranty in any form or shape whatsoever!. There is no guarantee that these instructions are up-to-date. With that understood you may continue with the rest of this page if you choose to accept these terms.
This page was last updated on November 9, 2011.
Go to https://developer.apple.com/xcode/ and download and install Xcode n, where n is either 4 or 4.2 depending on which operating system you are using on your Mac.
Once you install it, you can compile and run a C++ program, e.g., hello.cpp from command line as follows:
> g++ -g hello.cpp -o hello -lm // To compile > hello or ./hello if ./ is not included in PATH // To run