編碼的世界 / 優質文選 / 女人

Ubuntu 18.04安裝gcc、g++ 4.8


2022年6月15日
-   

直接使用命令安裝
sudo apt-get install gcc-4.8 g++-4.8

查看是否安裝好了
ls /usr/bin/gcc*

結果:
/usr/bin/g++
/usr/bin/g++-4.8
/usr/bin/gcc
/usr/bin/gcc-4.8
/usr/bin/gcc-ar-4.8
/usr/bin/gcc-nm-4.8
/usr/bin/gcc-ranlib-4.8

應用gcc
sudo update-alternatives install /usr/bin/gcc gcc /usr/bin/gcc-4.8 100
sudo update-alternatives config gcc

檢查gcc
gcc version

結果:
gcc (Ubuntu 4.8.5-4ubuntu8) 4.8.5
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

應用g++
sudo update-alternatives install /usr/bin/g++ g++ /usr/bin/g++-4.8 100
sudo update-alternatives config g++

檢查g++
g++ version

結果:
g++ (Ubuntu 4.8.5-4ubuntu8) 4.8.5
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

 





開發者漲薪指南


48位大咖的思考法則、工作方式、邏輯體系

熱門文章