I just had a fresh re-installation of Mac OS X Yosemite before I install Xcode and then CommandlineTools.
It seems I have two versions of gcc and g++ in the following two directories:
/usr/bin (both files are 14kb) and
/Library/Developer/CommandLineTools/usr/bin (g++ is just an alias and gcc is 19kb)
Type "which gcc" in the Terminal gives me "/usr/bin/gcc", so did "which g++" which gives me "/usr/bin/g++", and this means the system will only use the gcc and g++ in /usr/bin
So, my questions are:
1. why do I have two versions of gcc and g++?
2. why the gcc and g++ installed with CommandLineTools is not specified as the default ones?
3. How do I ask the Mac OS X to point to the gcc and g++ in the directory "/Library/Developer/CommandLineTools/usr/bin"?
BTW, i installed CommandlineTools according to the following:
http://railsapps.github.io/xcode-command-line-tools.html
However, I got a different output by typing "gcc --version" (difference hightlighted):
Configured with: --prefix=/Application/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1 Apple LLVM version 6.0 (clang-600.0.54) (based on LLVM 3.5svn) Target: x86_64-apple-darwin14.0.0 Thread model: posix
... rather than /Library/Developer/CommandLineTools/usr as shown in the web page above ...
I'm quite confused about which gcc/g++ is actually being used by Mac OSX currently ...
It seems I have two versions of gcc and g++ in the following two directories:
/usr/bin (both files are 14kb) and
/Library/Developer/CommandLineTools/usr/bin (g++ is just an alias and gcc is 19kb)
Type "which gcc" in the Terminal gives me "/usr/bin/gcc", so did "which g++" which gives me "/usr/bin/g++", and this means the system will only use the gcc and g++ in /usr/bin
So, my questions are:
1. why do I have two versions of gcc and g++?
2. why the gcc and g++ installed with CommandLineTools is not specified as the default ones?
3. How do I ask the Mac OS X to point to the gcc and g++ in the directory "/Library/Developer/CommandLineTools/usr/bin"?
BTW, i installed CommandlineTools according to the following:
http://railsapps.github.io/xcode-command-line-tools.html
However, I got a different output by typing "gcc --version" (difference hightlighted):
Configured with: --prefix=/Application/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1 Apple LLVM version 6.0 (clang-600.0.54) (based on LLVM 3.5svn) Target: x86_64-apple-darwin14.0.0 Thread model: posix
... rather than /Library/Developer/CommandLineTools/usr as shown in the web page above ...
I'm quite confused about which gcc/g++ is actually being used by Mac OSX currently ...