0

Hi,

I'm trying to install GCC 4.5.1 on Ubuntu for C++ programming.

So far, I've tried a myriad of different commands in Terminal to try to update GCC (the preinstalled version is 4.3.2), but none of them seem to work. When I go to update my packages with Synaptic Package Manager, it gives me a bunch of errors telling me that it failed to connect to the repository.

Also, I've tried just compiling a C++ file with the preinstalled GCC, and it tells me that cc1plus wasn't found.

Any suggestions?

3
Contributors
4
Replies
5
Views
7 Years
Discussion Span
Last Post by IsharaComix
0

hi coil,
try
sudo apt-get install build-essential
try
which g++
will give you the path to g++ binary. If this doesn't work, try
sudo apt-get install g++

Hope this works[assuming your OS Ubuntu].

Cheers
Sarma CSMG

0

What version of Ubuntu are you using? If you're using a version that has 4.3 in the repositories, you will have a very hard time trying to upgrade it to 4.5. It might be easier to install a new version of Ubuntu than it is to upgrade the compiler.

Edited by IsharaComix: n/a

0

Thanks for your replies!

I did try running the build-essential commands and trying to directly install g++ with sudo apt-get, but neither of them solved my problem.

Ishara: So if I install version 10, I assume that GCC 4.5 will be installed - are there any other utilities I need to install then for C++ programming, or is that it?

Edited by coil: n/a

0

If you install 10.10 and install 'g++' through Synaptic, you should be set up to compile c++ code with no further work. I don't know if the compiler is installed by default, but you should be able to get it through the repository.

Out of curiosity, when you compile your c++ code, you are trying to compile it using "g++ file.cpp", right?

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.