Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm Sender: cygwin-owner AT sourceware DOT cygnus DOT com Delivered-To: mailing list cygwin AT sourceware DOT cygnus DOT com Message-ID: <008f01bec888$9535efc0$c3dba1d1@Xu.toronto.vr1.com> From: "Wei Xu" <weixuz AT yesic DOT com> To: "Jonathan Pryor" <jonpryor AT vt DOT edu>, <cygwin AT sourceware DOT cygnus DOT com> Subject: Re: gcc library Date: Wed, 7 Jul 1999 10:54:15 -0400 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 4.72.3110.1 X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3 Thanks for your reply. Your example works with g++. When I use gcc, still the same mistake: undefined reference. -----Original Message----- From: Jonathan Pryor <jonpryor AT vt DOT edu> To: Wei Xu <weixuz AT yesic DOT com>; cygwin AT sourceware DOT cygnus DOT com <cygwin AT sourceware DOT cygnus DOT com> Date: Wednesday, July 07, 1999 10:40 AM Subject: 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>... > > // example.... > #include <iostream> > #include <stdio.h> > > using namespace std; > > int main () > { > cout << "Hello, world!\n"; > printf ("Hello again, world!\n"); > return 0; > } > > - Jon >----- Original Message ----- >From: Wei Xu <weixuz AT yesic DOT com> >To: <cygwin AT sourceware DOT cygnus DOT com> >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 <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 = >> `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: >> ><snipped...> > -- Want to unsubscribe from this list? Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com