tags:

views:

5427

answers:

6

There is a Debian g++-4.4 package, but it's not Ubuntu. There are too many system-destroyed scary stories on the web.

How can I install g++ 4.4 on Ubuntu?

+2  A: 

Debian packages should work on Ubuntu. It is based on Debian.

Edit: Try this :

sudo apt-get install gcc-snapshot
Zifre
Or wait until ubuntu provides it. GCC 4.4 was just released and it may take a while for distributions to provide packages for it.
lothar
I don't think he wants to wait 6 months for the next Ubuntu release.
Zifre
Isn't it that debian and ubuntu packages are binary-incompatible?
Łukasz Lew
Ubuntu and Debian are binary compatible, AFAIK. If you are worried about binary compatibility, use gcc-snapshot (a Ubuntu package).
Zifre
"debian experimental packages won't work with ubuntu- mostly because ubuntu is built differently, despite being debian-based." from https://answers.launchpad.net/ubuntu/+question/16018Is it not true any more?
Łukasz Lew
gcc-snapshot (20081024-0ubuntu1)http://packages.ubuntu.com/intrepid/gcc-snapshotIf the date is right, there can't be gcc-4.4And is there g++ at all?
Łukasz Lew
G++ is part of GCC.
Zifre
Thanks Zifire $ /usr/lib/gcc-snapshot/bin/g++ --versiong++ (Ubuntu 20081024-0ubuntu1) 4.4.0 20081024 (experimental) [trunk revision 141342]It's quite old.
Łukasz Lew
A: 

I would recommend against it. Requiring a newer version of g++ will require that if you use any new features of 4.4 then your users will also require a 4.4 runtime library. That being said, I would just download the source, ./configure --ALLMYOPTS&&make && sudo make install. If you want to make a gcc similar to the one shipped with Ubuntu, apt-get source gcc and look in debian/rules for their configure flags (they may be applied on multiple lines).

MighMoS
Compiling GCC is much harder than it sounds.
Zifre
sudo make install is a bad, bad, *bad* idea. Why not simply configure --prefix=/home/whatever/some/path/here and make install as that user?
Mihai Limbășan
Running "sudo make install" is the way to install this for all users of your system, right? Or would you plan on installing this to your home directory and then moving it to prevent the install script from doing anything untoward? Not trying to be critical, just curious why you think this is so terrible.
James Thompson
A: 

If it is in a debian repository, it should would under Ubuntu no problem. If you would like to add a repository, simply follow the directions here.

John T
+3  A: 

Have a look at this URL. I installed gcc-4.4 (and g++-4.4) from there, which seem to be the most official group of hackers that actually put gcc-4.4 into an ubuntu .deb. Till now running without problems :

https://launchpad.net/~ubuntu-toolchain/+archive/ppa

Regards.

Diego Sevilla
I added repository gcc-4.4 installs fine, but g++-4.4 gives error that libc6 >=2.8 is not available. While I have it installed. Any ideas?
Łukasz Lew
These repositories are for jaunty. What ubuntu distribution do you have?
Diego Sevilla
I have ubuntu 8.10
Łukasz Lew
A: 

I recomend you install build-essential package that contains g++.

Type it in your terminal:

$ sudo apt-get install build-essential

Then confirm installation.

Lucas Arbiza