<iostream> does not work??

Guy Van Den Bergh guy.vandenbergh2@advalvas.be
Fri Oct 1 00:00:00 GMT 1999


The top of newbie problems:
The program "Hello world" doesn't compile.
The code is:

#include<iostream>

int main()
{
std::cout<<"Hello, world!\n";
}
-----------------------------
And the output of CygWin (gcc under Linux did the same thing!):

BASH.EXE-2.02$ gcc helloworld.cpp
C:\WINDOWS\TEMP\cchV55g9.o(.text+0x1e):helloworld.cc: undefined
reference to `cout'
C:\WINDOWS\TEMP\cchV55g9.o(.text+0x23):helloworld.cc: undefined
reference to `ostream::operator<<(char const *)'
collect2: ld returned 1 exit status
-----------------------------------------------
I also tried with <iostream.h> instead of <iostream>, but that didn't
make any difference.
Can somebody tell me what is going on?
Thanks!

Guy Van Den Bergh





More information about the Gcc-help mailing list