An excellent piece of code to do the above is here: //clang++ -std=c++11 -stdlib=libc++ -framework Foundation nsarray.mm -o nsarray /* Note: * - libstdc++ has been frozen by Apple at a pre-C++11 version, so you must opt for the newer, BSD-licensed libc++ * - Apple clang 4.0 …