Linux: Difference between revisions

739 bytes added ,  7 February 2020
No edit summary
Line 135: Line 135:
==Default gcc/g++ version==
==Default gcc/g++ version==
See [https://askubuntu.com/questions/26498/how-to-choose-the-default-gcc-and-g-version https://askubuntu.com/questions/26498/how-to-choose-the-default-gcc-and-g-version].<br>
See [https://askubuntu.com/questions/26498/how-to-choose-the-default-gcc-and-g-version https://askubuntu.com/questions/26498/how-to-choose-the-default-gcc-and-g-version].<br>
<syntaxhighlight lang="bash">
# Install
sudo update-alternatives --remove-all gcc
sudo update-alternatives --remove-all g++
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 10
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 20
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-8 10
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-7 20
sudo update-alternatives --install /usr/bin/cc cc /usr/bin/gcc 30
sudo update-alternatives --set cc /usr/bin/gcc
sudo update-alternatives --install /usr/bin/c++ c++ /usr/bin/g++ 30
sudo update-alternatives --set c++ /usr/bin/g++
# Select
sudo update-alternatives --config gcc
sudo update-alternatives --config g++
</syntaxhighlight>


==apt==
==apt==