Solved

Can't use C++....

Posted on 1998-09-29
3
202 Views
Last Modified: 2013-12-06
I am running Red Hat 5.1. I wrote some code in C++ but when i went to compile it, it said it couldn't find the header files. I checked to see if i had installed them and I did. But the header files are nowhere to be found. Also, when I ran gcc it said it couldnt fing cc1plus. That is also supposed to beinstalled but again its nowhere to be found. any ideas?

0
Comment
Question by:GreatOne
  • 2
3 Comments
 
LVL 2

Expert Comment

by:mlev
ID: 1638173
All header files or just C++ header files?
Did you compile with g++ rather than gcc?
Try "rpm -V glibc-devel libstdc++-devel gcc egcs-c++"
0
 

Author Comment

by:GreatOne
ID: 1638174
Just the C++ header files are missing. I was able to compile it with g++ but I like gcc better. And I typed in that rpm command line. And nothing happened. I tried unintsalling and reinstalling but that did not work either. any more ideas?


0
 
LVL 2

Accepted Solution

by:
mlev earned 30 total points
ID: 1638175
Well, everything is okay then.
Disappointing as it may seem, while you may like gcc better,
g++ is the command to compile C++ programs with. The difference
is in flags. For example, g++ runs the compiler stage with -I/usr/include/g++ (that's where your C++ headers are),
and the linker stage with -lstdc++.
0

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
capture pcap with filtered traffic 1 65
installing LSI MegaRAID Storage Manager on CentOS 7 22 355
linux(debian) mouse poor performance 4 41
Non admin needs to install programs 17 38
Setting up Secure Ubuntu server on VMware 1.      Insert the Ubuntu Server distribution CD or attach the ISO of the CD which is in the “Datastore”. Note that it is important to install the x64 edition on servers, not the X86 editions. 2.      Power on th…
If you don't know how to downgrade, my instructions below should be helpful.
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question