Ubuntu 18.04 將gcc版本降級為5.5版本


Remark: Polynomial algebra 程序由於版本問題只能在gcc 5.0 版本運行, 而ubuntu更新會將gcc 更新到7.0版本,出現沖突(報錯:如下)

collect2: error: ld returned 1 exit status

Makefile:34: recipe for target 'LEORHEKF.exe' failed

make: *** [LEORHEKF.exe] Error 1

 

解決方法:

將gcc版本從7.3降級為5.5版本

 

方法如下:

 

首先查看自己的gcc版本,Ubuntu18.04上默認的是7.3版本

>>gcc --version

結果為:
gcc (Ubuntu 7.3.0-27ubuntu1~18.04) 7.3.0
Copyright (C) 2017 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.

降級方法
1. 下載gcc/g++ 5
sudo apt-get install -y gcc-5
sudo apt-get install -y g++-5


2. 鏈接gcc/g++實現降級
cd /usr/bin
sudo rm gcc
sudo ln -s gcc-5 gcc
sudo rm g++
sudo ln -s g++-5 g++

確認版本降級成功

再次查看gcc版本,可以看到已經降級.

>>gcc --version
gcc (Ubuntu 5.5.0-12ubuntu1) 5.5.0 20171010
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.
————————————————
版權聲明:本文為CSDN博主「CAU_Ayao」的原創文章,遵循 CC 4.0 BY-SA 版權協議,轉載請附上原文出處鏈接及本聲明。
原文鏈接:https://blog.csdn.net/CAU_Ayao/java/article/details/83987120


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM