在 2018/5/5 20:13, 夏晗 写道:
root@Xia-Ubuntu:/usr/bin# gcc -v
使用内建 specs。
COLLECT_GCC=gcc
目标:x86_64-pc-linux-gnu
配置为:../configure -enable-checking=release -enable-languages=c,c++ 
-disable-multilib
线程模型:posix
gcc 版本 6.2.0 (GCC)
I have tried many methods like 'ln' and priority changing, but 'gcc -v' still 
maintain at '6.2.0'.......


If you are using Ubuntu, the command `gcc` is a symlink to whichever version selected by your Ubuntu release and is the one used to build all system packages. Consequently, using a different target might result in binary incompatibility and is not recommended.

If you would like to invoke a different version of GCC, append the version number to it. This is true for all official releases and PPA packages.

For example, to invoke GCC 7 explicitly, you have to ensure it is installed by running `sudo apt-get install gcc-7`. The command `gcc-7` will be available thereafter and can be invoked either directly or indirectly by setting the `CC` environment variable.

--
Best regards,
LH_Mouse

Reply via email to