Toni Mueller wrote:
> -------------------------
> #include "iostream.h"
> int main(){ cout << "Hello World!" << endl; return 0;}
> -------------------------
>
> Compiling it goes like this:
>
> $ c++ testit.cc
> /tmp//cch21612.o(.text+0x1c): In function `main':
> : undefined reference to `endl(ostream&)'
> /tmp//cch21612.o(.text+0x29): In function `main':
> : undefined reference to `cout'
> /tmp//cch21612.o(.text+0x2e): In function `main':
> : undefined reference to `ostream::operator<<(char const*)'
> /tmp//cch21612.o(.text+0x37): In function `main':
> : undefined reference to `ostream::operator<<(ostream& (*)(ostream&))'
> collect2: ld returned 1 exit status
You must have screwed up your compiler installation. This program
compiles and links fine on my -current machines, although it of course
spits out a huge warning about the deprecated iostream.h header.
Are you sure there is no rogue iostream.h file lying around somewhere in
your compiler include path? You shouldn't use " includes unless you
know that you need them.