Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question
add comment

2 Answers

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.

share|improve this answer
    
Thank you Khaled. That was helpful. –  Deep Dec 29 '10 at 8:25
add comment

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
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.