This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Error with iostream.h
- From: Richard James Lewis <Richard dot Lewis at uea dot ac dot uk>
- To: gcc-help at gcc dot gnu dot org
- Date: Thu, 11 Jul 2002 15:09:37 +0100 (BST)
- Subject: Error with iostream.h
I've recently installed Red Hat Linux 7.3.
The following program won't compile with command: gcc test.cc
test.cc:
#include <iostream.h>
int main() {
cout << "Hello World!" << endl;
return 0;
}
it seems to think that cout is undefined:
/tmp/ccY0SwAX.o: In function `main':
/tmp/ccY0SwAX.o(.text+0xa): undefined reference to `endl(ostream &)'
/tmp/ccY0SwAX.o(.text+0x17): undefined reference to `cout'
/tmp/ccY0SwAX.o(.text+0x1c): undefined reference to
`ostream::operator<<(char const *)'
/tmp/ccY0SwAX.o(.text+0x27): undefined reference to
`ostream::operator<<(ostream &(*)(ostream &))'
collect2: ld returned 1 exit status
Any ideas?