CPlusPlus

Make sure you have installed Xcode command line tools. Check the C++ version to make sure it is Clang 4.0+.

  1. $ c++ --version
  2. Apple LLVM version 5.1 (clang-503.0.38) (based on LLVM 3.4svn)
  3. Target: x86_64-apple-darwin13.1.0
  4. Thread model: posix

To be able to compile files from your terminal you can add the following alias in your env.sh file.

  1. alias cppcompile='c++ -std=c++11 -stdlib=libc++'

Then you can run all cpp file directly using cppcompile main.cpp and it will use C++11 so no errors in the case of using vectors, auto, sets etc.