I currently have the gcc4.7 and the gcc4.7-base, etc., packages installed but GCC seems to still be using 4.6 when I call
gcc --version
I could compile the source code if I really needed it now, but I plan on converting some old code to have fun with C++11. If anyone has any suggestions on how to switch from 4.6 to 4.7 do tell.
I followed the guide from here :
https://askubuntu.com/questions/113291/installing-gcc-4-7
Edit: Fixed the issue, updated link to /usr/bin/gcc-4.7
Chances are that many programs compiled for gcc 4.6 may not work for gcc 4.7. Hence you must keep both and at the same time make the link to gcc4.7 vary according to the situation. You can edit your gcc file to be a shell script :
Now, whenever you find a program not working on gcc4.7 just add a new environment variable and you have switched to gcc4.6 for the current execution. Notice that for a multi-user system, this can prove to be a life saver.
You can just set your
CC
environment variable to/usr/bin/gcc-4.7
or whatever it is. Or maybe your build system has a different way to choose which compiler to use.Try running the following to see where gcc is located:
I'd say that odds are all you may need to do is update the link (but then again I can't check as I'm not booted into Linux at the moment)