This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
<iostream> does not work??
- To: help-gcc at gnu dot org
- Subject: <iostream> does not work??
- From: Guy Van Den Bergh <guy dot vandenbergh2 at advalvas dot be>
- Date: Sun, 22 Aug 1999 02:44:03 +0000
- Newsgroups: gnu.gcc.help
- Organization: UUNET Benelux (post does not reflect views of UUNET Benelux)
- Xref: wodc7nx0 gnu.gcc.help:646
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