close

From:

- http://askubuntu.com/questions/466651/how-do-i-use-the-latest-gcc-4-9-on-ubuntu-14-04

- http://superuser.com/questions/310809/how-can-i-update-gcc-to-the-latest-version-in-ubuntu-10-04/394811

===============================================

# Update repo
$sudo add-apt-repository ppa:ubuntu-toolchain-r/test # This may be omitted if could fund gcc and g++ you wnat
$sudo apt-get update
# Install gcc and g++
sudo apt-get install gcc-4.6
sudo apt-get install g++-4.6

# Switch to the new gcc and g++
# "20" is the priority weight so make it default by giving a higher priority
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.6 20
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.6 20
sudo update-alternatives --config gcc
sudo update-alternatives --config g++

 

# Query alternatives to see our settings 
sudo update-alternatives query gcc 
sudo update-alternatives query g++

 

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 Foxbrush 的頭像
    Foxbrush

    Foxbrush

    Foxbrush 發表在 痞客邦 留言(0) 人氣()