For sake, you can download the command line tools via XCode > OpenDeveloper Tool > More developer tools. But, although sources suggest that this can help with installing GCC, in my experience it is unclear whether that actually works.
You probably need an XCode plugin
There are two plugins at hmazhar/xcode-gcc on Github. I choose the 5.2 plugin and copy to the designated location.
You want GCC 5.2
I used to install GCC via home-brew, which provides the perfect excuse to go for a two hours walk in the park. But you know what? At the time of writing (April 2016) this doesn't work anymore.
Note: the following steps are likely to erase/override any previous GCC install.
- Used a tarball
- ditto to copy the tarball to usr/local (DO NOT copy via Finder as it will trash your /usr folder - Probably an obscure terminal command would have saved me the hassle, eh)
- Renamed gcc to gcc-5 as hinted by XCode's response to the build command.
Config for C++11
- Under Other C++ Flags you may need to add a flag for C++ 11 support.