install gcc-4.8 and g++-4.8 on ubuntu16.04

the default gcc on ubuntu16.04 is gcc-5.4 (and g++-5.4). Below is the way to install gcc4.8 (and g++-4.8):

install gcc-4.8 and g++-4.8 on ubuntu16.04

sudo aptitude install gcc-4.8
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-5 999
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 800
sudo aptitude install g++-4.8
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.8 800
sudo update-alternatives --config gcc
sudo update-alternatives --config g++

你可能感兴趣的:(toolchain)