g++ is the nickname for GCC. It is included in the BSD subsystem of MacOS X. AFAIK, every new Mac ships with the BSD subsystem installed and, thus, GCC available out of the box. Xcode uses GCC as its compiler engine. The takeaway message is that you don't have to install GCC unless you uninstalled it sometime in the past.