Error in compiling header files

Hi everyone.....
I am using red hat linux server 5.1, and all the packages are installed.
I dont have "list.h" (header file) in my gcc comipler, as well as the "cout" command gives me error while compiling.
gcc is a C compiler. You probably want to use g++
Or please try just 'list' and don't forget about std namespace.
Thanks for replies...
I have a gcc compiler, which does not support c++ commands.
I need to install g++, what should i do.
Run this:
yum install gcc-c++
this command isnt working.
"isn't working" is not a valid problem description.
it says installed but not available & nothing to do and then it terminates..!
Maybe you should copy & paste the exact message...
What happens if you run
g++ -v
?
this is the message i get when i type yum install gcc-c++
"Loaded plugins: rhnplugin, security
This system is not registered with RHN.
RHN support will be disabled.
ftp://ftp.redhat.com/pub/redhat/linux/enterprise/5Server/en/os/i386/Debuginfo/repodata/repomd.xml: [Errno 4] IOError: <urlopen error (-2, 'Name or service not known')>
Trying other mirror.
Error: Cannot retrieve repository metadata (repomd.xml) for repository: rhel-debuginfo. Please verify its path and try again"

and similarly when i typed g++ -v i got the message :

"Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-libgcj-multifile --enable-languages=c,c++,objc,obj-c++,java,fortran,ada --enable-java-awt=gtk --disable-dssi --enable-plugin --with-java-home=/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre --with-cpu=generic --host=i386-redhat-linux
Thread model: posix
gcc version 4.1.2 20080704 (Red Hat 4.1.2-44)"
Well, apparently g++ is already installed.
So to come back to your first post: there is no file called list.h in C++. If you want to use std::list, its header is called "list".
well the problem i am facing is that list.h is not there !
Reading comprehension problems?
Denis already told you before that it's list and not list.h.
You shouldn't abuse people's patience.
Last edited on
well i am using list now but again i am facing this problem..!
You should post the code, the exact error message you're getting and how you're invoking g++.
Topic archived. No new replies allowed.