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]

<iostream> does not work??


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




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