Ubuntu – Terminal commands for installing g++ 4.8

compilingg++gccprogramming

Could somebody please advise how I could install g++ 4.8 ? I understand its not an official release yet (and that I would need to manually download a file) but I get internal compiler bug issues with 4.7 and apparently the bug has been fixed in 4.8.

The problem is I do not know how to manually install g++ 4.8 when downloading the file etc.

Thanks in advance

Best Answer

For 13.10:

Just use sudo apt-get install g++-4.8.

For 13.04 and earlier:

Use the ubuntu-toolchain ppa:

sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install g++-4.8