25

Some time ago, I managed to find PPA featuring g++-4.7 build. However, I had to reinstall everything on my machine and I lost name of that PPA. Could anyone point me to it? I tried to find it again, but without any luck. I'm on Ubuntu 11.10 installation.

Jorge Castro
  • 73,717
Griwes
  • 354

3 Answers3

23

The Toolchain test builds PPA contains many packages including gcc-4.7.

You can add the repository using

sudo add-apt-repository ppa:ubuntu-toolchain-r/test

Then, to install it use

sudo apt-get update
sudo apt-get install g++-4.7

To change the default compiler use update-alternatives

sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.6 60 --slave /usr/bin/g++ g++ /usr/bin/g++-4.6
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.7 40 --slave /usr/bin/g++ g++ /usr/bin/g++-4.7
sudo update-alternatives --config gcc
0

See http://ask.debian.net/questions/backporting-more-recent-versions-of-the-gcc-toolchain-to-debian-stable

for my description of backporting gcc 4.7 to Debian stable.

Faheem Mitha
  • 7,871
0

I haven't found a PPA for g++-4.7 but there is a gcc-snapshot package.

I guess you have to compile it yourself: http://www.lukaszbyczynski.com/archives/208

sroecker
  • 2,620