G++ stl libraries in Darwin

darwingcc

I am trying to understand how some of the data structures are designed in stl. In ubuntu, I usually open the .h and .cpp files from /usr/local/include but in Darwin (kernel version 14.3.0) I am lost, google doesnt help much either, the file structure is different. So, could you please tell me where are those libraries' .h and .cpp files in mac?

P.S. I installed XCode but I didnt like it so I uninstalled it. The g++ stayed even after uninstall. Actually I never tried checking whether g++ was there before I installed Xcode. I dont have /Applications/Xcode.app so it must be someplace else.

Best Answer

OS X does not include c++ compilers.

You need to install Xcode and/or its command line tools to get clang (note not gcc)

The C++ standard libraries (which do not need to be actual files but are in libc++ which is the Xcode default library) The include files are in /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/