sudo apt install build-essential
gcc --version (查看gcc版本)
可以看到我的gcc版本是4.8.5
安装最新版gcc9
sudo apt install software-properties-common
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt install gcc-9 g++-9
查看各个gcc版本的优先级,分数越高优先级越高
sudo update-alternatives --config gcc
更改优先级(可以用以下命令,将你想要的gcc版本优先级改为最高)
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 100
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)