This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
RE: building gcc-2.95.2 with libstdc++-2.90.8 library on RH 6.2
- To: <manjunath at iitbombay dot org>
- Subject: RE: building gcc-2.95.2 with libstdc++-2.90.8 library on RH 6.2
- From: "Rupert Wood" <me at rupey dot net>
- Date: Tue, 13 Nov 2001 10:15:07 -0000
- Cc: <gcc-help at gcc dot gnu dot org>
Manjunath H Bhajantri wrote:
> But I am not able to build properly. Because my HelloWorld.cxx
> "#include <iostream.h> int main() { cout <<"Hello, World!"<<endl;}"
> is not compiling, giving the error /tmp/ccGZV1Sn.o: In function
`main':
> /tmp/ccGZV1Sn.o(.text+0xa): undefined reference to `endl(ostream &)'
You're using:
gcc HelloWorld.cxx
when you should be using:
g++ HelloWorld.cxx
The g++ compiler driver will automatically link in the necessary C++
libraries.
There are no namespace problems with this code. However, <iostream.h>
has been deprecated in GCC 3.0+ in favour of <iostream> (which defines
everything in the 'std' namespace).
Hope that helps,
Rup.