From: "Wei Xu" <weixuz@yesic.com>
To: "Jonathan Pryor" <jonpryor@vt.edu>, <cygwin@sourceware.cygnus.com>
Subject: Re: gcc library
Date: Sat, 31 Jul 1999 18:34:00 -0000 [thread overview]
Message-ID: <008f01bec888$9535efc0$c3dba1d1@Xu.toronto.vr1.com> (raw)
Message-ID: <19990731183400.ktOUkNF1I39xqE9T0H6Ak4DNUFWPO0q0L4AqG8vN2oI@z> (raw)
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@vt.edu>
To: Wei Xu <weixuz@yesic.com>; cygwin@sourceware.cygnus.com
<cygwin@sourceware.cygnus.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@yesic.com>
>To: <cygwin@sourceware.cygnus.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@sourceware.cygnus.com
next reply other threads:[~1999-07-31 18:34 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
1999-07-07 7:55 Wei Xu [this message]
1999-07-31 18:34 ` Wei Xu
-- strict thread matches above, loose matches on Subject: below --
1999-07-07 7:54 Thomas Pfaff
1999-07-31 18:34 ` Thomas Pfaff
1999-07-07 7:16 Wei Xu
1999-07-07 7:41 ` Jonathan Pryor
1999-07-31 18:34 ` Jonathan Pryor
1999-07-07 7:47 ` Raju K. V.
1999-07-31 18:34 ` Raju K. V.
1999-07-31 18:34 ` Wei Xu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='008f01bec888$9535efc0$c3dba1d1@Xu.toronto.vr1.com' \
--to=weixuz@yesic.com \
--cc=cygwin@sourceware.cygnus.com \
--cc=jonpryor@vt.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).