From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Jonathan Pryor" To: "Wei Xu" , Subject: Re: gcc library Date: Wed, 07 Jul 1999 07:41:00 -0000 Message-id: <043701bec886$c08e32b0$e63d2509@raleigh.ibm.com> References: <003901bec883$34bc9e00$c3dba1d1@Xu.toronto.vr1.com> X-SW-Source: 1999-07/msg00126.html doesn't provide the prototype for printf. You need to include . Also, the use of has been deprecated by the C++ standard. You should use , which places everything in the std namespace. Additionally, has been deprecated in favor of , which also places the contents into the std namespace; however, not all compilers support , so I tend to stick with ... // example.... #include #include using namespace std; int main () { cout << "Hello, world!\n"; printf ("Hello again, world!\n"); return 0; } - Jon ----- Original Message ----- From: Wei Xu To: 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. When > I try to testing the = > gcc with the following C++ code: > > #include > > 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 = > `cout' > C:\WINDOWS\TEMP\ccz14xFI.o(.text+0x23):try.cc: undefined reference to = > `ostream:: > 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 cygwin-unsubscribe@sourceware.cygnus.com From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Jonathan Pryor" To: "Wei Xu" , Subject: Re: gcc library Date: Sat, 31 Jul 1999 18:34:00 -0000 Message-ID: <043701bec886$c08e32b0$e63d2509@raleigh.ibm.com> References: <003901bec883$34bc9e00$c3dba1d1@Xu.toronto.vr1.com> X-SW-Source: 1999-07n/msg00126.html Message-ID: <19990731183400.74WRzrxoyWPcp97Nb0Mquf1fxUZQmy9hZLCOCgdSUuU@z> doesn't provide the prototype for printf. You need to include . Also, the use of has been deprecated by the C++ standard. You should use , which places everything in the std namespace. Additionally, has been deprecated in favor of , which also places the contents into the std namespace; however, not all compilers support , so I tend to stick with ... // example.... #include #include using namespace std; int main () { cout << "Hello, world!\n"; printf ("Hello again, world!\n"); return 0; } - Jon ----- Original Message ----- From: Wei Xu To: 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. When > I try to testing the = > gcc with the following C++ code: > > #include > > 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 = > `cout' > C:\WINDOWS\TEMP\ccz14xFI.o(.text+0x23):try.cc: undefined reference to = > `ostream:: > 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 cygwin-unsubscribe@sourceware.cygnus.com