Help answer threads with 0 replies.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
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.


  Search this Thread
Old 06-30-2004, 12:06 PM   #1
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
[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
Senior Member
Registered: Oct 2003
Posts: 2,699

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

$ rpm -qa | grep gcc
Looks like you need the gcc-cpp package. I believe it's the preprocessor for gcc.
Old 06-30-2004, 01:43 PM   #3
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
Senior Member
Registered: Oct 2003
Posts: 2,699

Rep: Reputation: 244Reputation: 244Reputation: 244
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
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"?
Old 07-02-2004, 05:50 PM   #6
Registered: Jan 2004
Posts: 35

Rep: Reputation: 15

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.


Old 07-07-2004, 07:21 AM   #7
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
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,697

Rep: Reputation: 232Reputation: 232Reputation: 232
vanhelsing, for example here:

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.


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
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 > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 02:00 PM.

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