I'm new to C++11. I've tried:
clang++ -std=c++11 -stdlib=libc++ *.cc
It works, but my questions is:
Thanks.
C code can be written in any platform like Mac, Windows, etc. C compilers compile C code and create an executable according to the platform. The executable created for one platform can only be executed on that platform. Following are different Mac C compilers.
Go to property of the project --> c/c++ build --> settings --> cross gcc compiler and cross g++ compiler. Put -std=c++11 under miscellaneous part of both tabs. Click Apply.
The name of the C compiler (that was installed along with the command line tools) is gcc. To check that this is now successfully installed, enter "gcc --version" at the prompt.
Brett has described how to install GCC it with MacPorts. Here’s how to do it with Homebrew, which styles itself (rightfully!) as a modern replacement of MacPorts:
brew tap homebrew/versions
brew install --enable-cxx gcc48
As far as I know the easiest way to install the most recent Clang is by downloading the compiled version linked in dsign’s answer – and, as Brett mentioned, since Apple uses clang internally it’s not advised to tinker with that installation – just put yours somewhere else.
Concerning what the “best” compiler is there are two things to consider in addition to what Brett has already said:
<regex>
implementation, which is a shame.If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With