LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Can't install g++ on new Red Hat (https://www.linuxquestions.org/questions/linux-newbie-8/cant-install-g-on-new-red-hat-700670/)

cscooper 01-28-2009 08:46 PM

Can't install g++ on new Red Hat
 
I've just installed Red Hat Enterprise Linux Desktop (v. 5 for 32-bit x86) on my laptop so I could do some c++ development for a class I'm taking, and I can't get the c++ compiler to work.

If I type

gcc server.cpp

(and yes, I realize once I get this working I will need more options like -o)

it responds

gcc: error trying to exec 'cc1plus': execvp: No such file or directory

I ran "Add/Remove Software" to bring up the "Package Manager", and it says (among other things) that I have installed:
compat-gcc-34-3.4.6-4.I386
compat-gcc-34-c++-3.4.6-4.I386
compat-libstdc++-33-3.2.3-61.I386
gcc-4.1.2-44.eI5.I386

I've tried:
yum install g++
and it says "No package g++ available"

As you can probably tell, I know just enough Linux to be dangerous. Any help will be much appreciated!

Thanks,
Chris

AlucardZero 01-28-2009 09:55 PM

yum install gcc-c++

Not sure the exact package name but Google says you just need g++.

cscooper 01-28-2009 11:10 PM

yum install gcc-c++

eventually says

No package gcc-c++ available
Nothing to do

cscooper 01-28-2009 11:10 PM

yum install g++

also says
No package g++ available
Nothing to do

linuxlover.chaitanya 01-29-2009 12:14 AM

If you are using RHEL5 then probably you have gcc-c++ on your cd/dvd. Use it to install the package.
Use rpm -qa | grep gcc to find if what already are installed.

cscooper 01-29-2009 07:35 AM

rpm -qa | grep gcc

says

compat-gcc-34-c++-3.4.6-4
libgcc-4.1.2-44.el5
gcc-4.1.2-44.el5
compat-gcc-34-3.4.6.4
compat-libgcc-296-2.96-138

That first one says c++ but maybe isn't quite the right one. Dunno.

I do have a DVD that I burned from the ISO file I got from the redhat site. How to transfer [whatever it is I need] from the DVD into my redhat install, I do not know.

Thanks,
Chris

AlucardZero 01-29-2009 11:40 AM

Now that I have a RHEL5 system onhand..

compat-gcc-34-c++-3.4.6-4 is g++ version 3.4. You probably have a /usr/bin/g++34.. if version 3.4.6 is fine for you you can use that.

Else, on your RedHat DVD find RPMs for gcc-c++ and libstdc++-devel (and maybe more dependencies...). Install the RPMs with (as root):
rpm -ivh file1.rpm file2.rpm ...
If it needs more dependencies it will tell you.

cscooper 01-29-2009 12:16 PM

Yes, I do have a /usr/bin/g++34.

As to whether version 3.4.6 is fine for me, I have no idea :-)

So ... this says I have g++ installed, but apparently I have missed a magical incantation somewhere along the line to let me actually use g++.

I have to set up some sort of alias that says that when I type g++, I actually mean /usr/bin/g++34? I vaguely remember that I used to know how to do that ...

I am running the GNOME desktop.

Thanks,
Chris

cscooper 01-29-2009 12:17 PM

And since I have /usr/bin/g++34, that means I don't have to find any RPMs on my DVD? If I still need to do that, I probably need help remembering how to mount a DVD (and/or search for RPMs on it).

Thanks again,
Chris

lazlow 01-29-2009 01:21 PM

Post the results of:

yum repolist


You should have a gcc-c++ package available. Since you do not seem to it MAY indicate that yum is not set up quite right.

Edit: You do understand that in order to use RH's repos you MUST have a subscription (pay)? Assuming you have a subscription, solving this kind of issue is exactly what you are paying for.

cscooper 01-29-2009 01:49 PM

yum repolist

returns

repo id = rhel-i386-clien-6
repo name = Red Hat Enterprise Linux Desktop (v. 5 f
status = enabled
(is the number after "enabled" important?)

I have the educational license/subscription, so it's all nice and legal, but I don't get any support.

Chris

lazlow 01-29-2009 01:55 PM

RH is a little "funny" with their educational license(ok, about a lot of things). I am not sure what all is included, it MAY not include all the build tools. You might want to look at Centos. Centos is RHEL without the logos. It is free to download/update.

linuxlover.chaitanya 01-29-2009 11:34 PM

This is what my rhel5 gives with rpm -qa | grep gcc

Code:

compat-gcc-34-g77-3.4.6-4
gcc-4.1.1-52.el5
gcc-gfortran-4.1.1-52.el5
libgcc-4.1.1-52.el5
compat-gcc-34-3.4.6-4
gcc-c++-4.1.1-52.el5
compat-gcc-34-c++-3.4.6-4
gcc-java-4.1.1-52.el5

And you should have this in your media
Code:

gcc-c++-4.1.1-52.el5
Install it.


All times are GMT -5. The time now is 05:21 AM.