This is the mail archive of the
mailing list for the Cygwin project.
Re: gcc library
<iostream.h> doesn't provide the prototype for printf.
You need to include <stdio.h>.
Also, the use of <iostream.h> has been deprecated by
the C++ standard. You should use <iostream>, which
places everything in the std namespace. Additionally,
<stdio.h> has been deprecated in favor of <cstdio>,
which also places the contents into the std namespace;
however, not all compilers support <cstdio>, so I tend
to stick with <stdio.h>...
using namespace std;
int main ()
cout << "Hello, world!\n";
printf ("Hello again, world!\n");
----- Original Message -----
From: Wei Xu <firstname.lastname@example.org>
Sent: Wednesday, July 07, 1999 10:15 AM
Subject: gcc library
> Dear all,
> I an new to this software. I have download the full verions of Cygwin.
> I try to testing the =
> gcc with the following C++ code:
> #include <iostream.h>
> int main (int argc, char **argv)
> cout << "Hello world\n";
> printf("Hello world\n");
> It says:
> try.cc: In function `int main(int, char **)':
> try.cc:6: warning: implicit declaration of function `int printf(...)'
> C:\WINDOWS\TEMP\ccz14xFI.o(.text+0x1e):try.cc: undefined reference to =
> C:\WINDOWS\TEMP\ccz14xFI.o(.text+0x23):try.cc: undefined reference to =
> operator<<(char const *)'
> collect2: ld returned 1 exit status
> I can figure out what is wrong with my installation or library?=20
> Here is my set:
Want to unsubscribe from this list?
Send a message to email@example.com