On OS X, I currently have a couple versions of gcc installed. Whenever I use gcc -v
or g++ -v
, it tells me: gcc version 4.2.1
. I have installed gcc 4.7, though, in the interest of taking advantage of C++11. How can I change it so that gcc/g++ points to 4.7 instead of 4.2.1?
EDIT: I have homebrew, not macports.
I think you can do something like this.
Go to /usr/bin
Assume you have install the gcc-4.7
using home brew in mavericks.
then type:
cd /usr/bin
sudo mv gcc gcc_mavs
sudo ln -s /usr/local/Cellar/gcc48/4.7.0/bin/gcc-4.7 gcc
After this type to verify if you have select the right gcc compiler.
gcc -v
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