1

I have Ubuntu 10.10. The command: g++ -v evokes the response gcc version 4.4.5 (Ubuntu/Linaro 4.4.4-14ubuntu5)

And the command sudo apt-get install g++ evokes the response g++ is already the newest version.

However, the following site tells me that the latest version of GNU is 4.5.2: http://gcc.gnu.org/

How do I upgrade my GCC compiler to the latest 4.5.2?

2 Answers 2

1

The apt-get install command tells you that this is the latest version depending on the Ubuntu repositories.

The GCC website tells you the latest version developed by GCC project. That is it.

So, you need to install the package from source if you want to run the latest version or wait until Ubuntu guys releases a new version to catch the current release. This is general and not related to GCC project only.

0
1

I did the following, and it works:

On the Ubuntu 10.10 menu: System -> Admin -> Synaptic Package Manager -> search for g++-4.5 and mark all for install. Ensure you mark the dependencies as well.

Go to folder /usr/bin and give the commands

ls -l g*
sudo rm g++ gcc
sudo ln -s g++ g++-4.5
sudo ln -s gcc gcc-4.5

Now to compile any C++0x programs you need to give the command

g++ -std=c++0x <source_file_name>.cpp

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .