This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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?


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]