--------“道路是曲折的,前途是光明的?!?/code>
Ubuntu14.04自帶的gcc版本是4.8,MATLAB2015a支持的最高版本為4.7x。因此,需要安裝gcc4.7,并給gcc降級(jí)
在終端執(zhí)行g(shù)cc 4.7的安裝命令:
sudo apt-get update
sudo apt-get install gcc-4.7 g++-4.7 g++-4.7-multilib gcc-4.7-multilib
在終端執(zhí)行以下系統(tǒng)gcc降級(jí)命令(其中數(shù)字越大,表示優(yōu)先級(jí)越高):
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.7 100
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.8 50
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.7 100
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 50
sudo update-alternatives --install /usr/bin/cpp cpp-bin /usr/bin/cpp-4.7 100
sudo update-alternatives --install /usr/bin/cpp cpp-bin /usr/bin/cpp-4.8 50
驗(yàn)證gcc-4.7是否安裝并成為系統(tǒng)的默認(rèn)版本:gcc -v
也可以將以上命令寫入一個(gè)shell文件中,執(zhí)行shell腳本。
參考:http://blog.csdn.net/m5061125/article/details/52603963
`Know more ,do more ,do better`