载并解压GCC源码后执行:
|
|
检验结果 由于我们指定了–prefix=$HOME,所以GCC的可执行文件将被安装到$HOME/bin,请确保该目录位于$PATH中,然后执行$ gcc –version确认GCC版本。 引用地址
##切换gcc版本
execute in terminal :
|
|
Okay, so that part is fairly simple. The tricky part is that when you issue the command GCC it is actually a sybolic link to which ever version of GCC you are using. What this means is we can create a symbolic link from GCC to whichever version of GCC we want. • You can see the symbolic link :
|
|
• So what we need to do is remove the GCC symlink and the G++ symlink and then recreate them linked to GCC 4.3 and G++ 4.3:
|
|
• Now if we check the symbolic links again we will see GCC & G++ are now linked to GCC 4.3 and G++ 4.3:
|
|
• Finally we can check our GCC -v again and make sure we are using the correct version:
|
|