LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 06-30-2004, 12:06 PM   #1
vanhelsing
Member
 
Registered: May 2004
Posts: 130

Rep: Reputation: 15
Why I can't compile c++


This 's all my work and my broblem

[root@localhost mycpp]# rpm -qa|grep gcc
compat-gcc-c++-7.3-2.96.118
gcc-3.2.2-5
libgcc-3.2.2-5
compat-gcc-7.3-2.96.118
[root@localhost mycpp]# g++ -Wall -I$QTDIR/include -L$QTDIR/lib hello.cpp -o hello -lqt
bash: g++: command not found
[root@localhost mycpp]#


 
Old 06-30-2004, 01:08 PM   #2
kilgoretrout
Senior Member
 
Registered: Oct 2003
Posts: 2,987

Rep: Reputation: 388Reputation: 388Reputation: 388Reputation: 388
Here's my output for the same command:

Quote:
$ rpm -qa | grep gcc
gcc-3.3.2-6mdk
gcc-c++-3.3.2-6mdk
gcc-cpp-3.3.2-6mdk
libgcc1-3.3.2-6mdk
Looks like you need the gcc-cpp package. I believe it's the preprocessor for gcc.
 
Old 06-30-2004, 01:43 PM   #3
vanhelsing
Member
 
Registered: May 2004
Posts: 130

Original Poster
Rep: Reputation: 15
I can't find gcc-cpp for redhat to install, pls recommend me one site.
I using redhat 9, i686
 
Old 06-30-2004, 03:00 PM   #4
kilgoretrout
Senior Member
 
Registered: Oct 2003
Posts: 2,987

Rep: Reputation: 388Reputation: 388Reputation: 388Reputation: 388
It may be under another package name in red hat. Try running:

# rpm -q --whatprovides gcc-cpp

That should list the package that provides gcc-cpp.

Also, check /usr/bin and see if gcc or g++ is listed. If not find out where they are located. It may not be in PATH. You can find out what files a given package has installed with:

# rpm -ql <package name>

That should list the location of the executable.

Edit: just noticed that you have "gcc-3.2.2-5" installed but don't seem to have a corresponding "gcc-c++-3.2.2-5" installed. Not sure what the "compat" packages do but they seem to provide a compatability layer for an earlier version of the compiler. The c++ compiler may not be installed at all. Try installing the "gcc-c++-3.2.2-5" package.

Last edited by kilgoretrout; 06-30-2004 at 03:24 PM.
 
Old 07-02-2004, 07:10 AM   #5
boom42k
LQ Newbie
 
Registered: Jul 2004
Posts: 4

Rep: Reputation: 0
hi, i am in exactly the same situation as vanhelsing, but i am a newbie as fresh as they come. i am using redhat 9, i686
and "# rpm -q --whatprovides gcc-cpp" doesnt do anything
in usr/bin there is a gcc296 and a g++296
but what do i do now?
how do i go about installing "gcc-c++-3.2.2-5"?
thanks
 
Old 07-02-2004, 05:50 PM   #6
dfownz
Member
 
Registered: Jan 2004
Posts: 35

Rep: Reputation: 15
http://68.110.196.244:73/linuxhelp/linuxhelp.php

Check out the Using Your Distro part for installation help.

I wrote it so tell me what helps ya. I plan on writting a ton more for that.

Peace,

DF
 
Old 07-07-2004, 07:21 AM   #7
boom42k
LQ Newbie
 
Registered: Jul 2004
Posts: 4

Rep: Reputation: 0
so you are saying i need to install the compiler?
i tried downloading 3.4.1 from the gcc site but i cant install that because when i go to configure it, it cant find the command "cc". also on the site it says there are links to binary files if you dont already have a compiler. but as far as i can tell there are none for redhat 9.
where do i go to get a compiler to install?
or is there one with the os that i havent noticed yet? is gcc even the command to compile a c++ program? or is it something else in redhat 9?
thanks if anyone can set me straight, i am getting myself so confused.
 
Old 07-07-2004, 03:48 PM   #8
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,696

Rep: Reputation: 232Reputation: 232Reputation: 232
vanhelsing, for example here: ftp://ftp.redhat.com/pub/redhat/linu...6/RedHat/RPMS/

boom42k, you need to have a compiler before compiling a new one. You probably need to install it from a package. g++ is the command.
 
  


Reply



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
How do I compile? icecream33 Programming 3 12-20-2017 11:49 AM
compile 2.6.13 jupiter3437 Linux - Software 3 09-09-2005 04:09 PM
ntop compile/post-compile problem? tjb Linux - Software 3 12-28-2004 04:22 PM
Cannot compile c davidtsl Programming 8 12-13-2004 01:36 AM
Compile help Twiggy794 Linux - Software 1 12-03-2003 01:53 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

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

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
Open Source Consulting | Domain Registration