LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-28-2009, 08:46 PM   #1
cscooper
LQ Newbie
 
Registered: Jan 2009
Posts: 7

Rep: Reputation: 0
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
 
Old 01-28-2009, 09:55 PM   #2
AlucardZero
Senior Member
 
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,685

Rep: Reputation: 565Reputation: 565Reputation: 565Reputation: 565Reputation: 565Reputation: 565
yum install gcc-c++

Not sure the exact package name but Google says you just need g++.
 
Old 01-28-2009, 11:10 PM   #3
cscooper
LQ Newbie
 
Registered: Jan 2009
Posts: 7

Original Poster
Rep: Reputation: 0
yum install gcc-c++

eventually says

No package gcc-c++ available
Nothing to do
 
Old 01-28-2009, 11:10 PM   #4
cscooper
LQ Newbie
 
Registered: Jan 2009
Posts: 7

Original Poster
Rep: Reputation: 0
yum install g++

also says
No package g++ available
Nothing to do
 
Old 01-29-2009, 12:14 AM   #5
linuxlover.chaitanya
Senior Member
 
Registered: Apr 2008
Location: Nagpur, India
Distribution: Cent OS 5/6, Ubuntu Server 10.04
Posts: 4,629

Rep: Reputation: Disabled
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.
 
Old 01-29-2009, 07:35 AM   #6
cscooper
LQ Newbie
 
Registered: Jan 2009
Posts: 7

Original Poster
Rep: Reputation: 0
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
 
Old 01-29-2009, 11:40 AM   #7
AlucardZero
Senior Member
 
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,685

Rep: Reputation: 565Reputation: 565Reputation: 565Reputation: 565Reputation: 565Reputation: 565
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.
 
Old 01-29-2009, 12:16 PM   #8
cscooper
LQ Newbie
 
Registered: Jan 2009
Posts: 7

Original Poster
Rep: Reputation: 0
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
 
Old 01-29-2009, 12:17 PM   #9
cscooper
LQ Newbie
 
Registered: Jan 2009
Posts: 7

Original Poster
Rep: Reputation: 0
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
 
Old 01-29-2009, 01:21 PM   #10
lazlow
Senior Member
 
Registered: Jan 2006
Posts: 4,362

Rep: Reputation: 172Reputation: 172
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.

Last edited by lazlow; 01-29-2009 at 01:23 PM.
 
Old 01-29-2009, 01:49 PM   #11
cscooper
LQ Newbie
 
Registered: Jan 2009
Posts: 7

Original Poster
Rep: Reputation: 0
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
 
Old 01-29-2009, 01:55 PM   #12
lazlow
Senior Member
 
Registered: Jan 2006
Posts: 4,362

Rep: Reputation: 172Reputation: 172
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.
 
Old 01-29-2009, 11:34 PM   #13
linuxlover.chaitanya
Senior Member
 
Registered: Apr 2008
Location: Nagpur, India
Distribution: Cent OS 5/6, Ubuntu Server 10.04
Posts: 4,629

Rep: Reputation: Disabled
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
During Red Hat Linux 9 install: error "No devices found to install Red Hat Linux" rbradtx Linux - Newbie 11 06-25-2010 04:55 PM
Red Hat Linux 9 install: error "No devices found to install ... gunneszz Red Hat 1 03-10-2008 04:52 AM
LXer: Red Hat Summit 2007, Day 2: Red Hat Exchange and interesting presentations LXer Syndicated Linux News 0 05-11-2007 07:32 PM
Install RED HAT 9 = cant find red hat CD voodooutt Red Hat 7 11-18-2003 05:37 PM


All times are GMT -5. The time now is 11:26 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration