I am trying to figure what the differences between "--version" output are when I check the versions of gcc/g++ and clang/clang++, which I understand should just be links to each other. Furthermore, it is unclear to me whether there is some way to update what I have given that I am locked on Mac OSX 10.9 right now. There is a bit too much to fit into the question, but in short, I am trying to prepare for playing with SDL. It's best that I post the console output and comment as I go along. I think that I have a few misunderstandings to sort; I did look at similar pages on stack overflow, but none of the discussions quite answer my questions
$ gcc --version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 6.0 (clang-600.0.57) (based on LLVM 3.5svn)
okay, so this is a rather old version, is there a safe way to update everything, or am I system locked? I remember installing command line tools and the latest version of Xcode, 6.2, available on my system
Target: x86_64-apple-darwin13.4.0
Thread model: posix
$ g++ --version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
4.2.1? I have Xcode 6.2 installed. Am I meant to rebuild something?
Apple LLVM version 6.0 (clang-600.0.57) (based on LLVM 3.5svn)
Target: x86_64-apple-darwin13.4.0
Thread model: posix
$ clang --version
Apple LLVM version 6.0 (clang-600.0.57) (based on LLVM 3.5svn)
Target: x86_64-apple-darwin13.4.0
Thread model: posix
$ clang++ --version
Apple LLVM version 6.0 (clang-600.0.57) (based on LLVM 3.5svn)
Target: x86_64-apple-darwin13.4.0
Thread model: posix
The clang printouts tell me nothing about the Xcode version, so I am not sure whether there is a difference here.
In short, am I meant to update or install something so I have a more recent set of compilers, or am I set? What is the real difference between the gcc/g++ and clang/clang++ information above? Lastly, can I update at all, and if so, in what way, and can I do so without any negative consequences?
Apologies in advance if the question is a bit too general/cloudy. I simply wish to make sure that I have a proper understanding of these messages and know how to proceed. Thank you.
On a modern Mac system,
gcc
is an alias forclang
, andg++
is an alias forclang++
.They're also components of Xcode (or the Xcode command-line tools, if you installed those). The installed version of clang is dependent on (but not the same as) the version of Xcode you have installed.
The "4.2.1" you're looking at is the version of the C++ headers. It will only confuse you. Ignore it.
If you want a newer version of the compiler, you will need to install a newer version of Xcode, and to do that, you will need to install a newer version of macOS.