This is the mail archive of the
cygwin@cygwin.com
mailing list for the Cygwin project.
Re: impure_ptr/Mingw and Cygwin
- From: "Max Bowsher" <maxb at ukf dot net>
- To: "Peter A. Castro" <doctor at fruitbat dot org>,"Andrew DeFaria" <ADeFaria at Salira dot com>
- Cc: <cygwin at cygwin dot com>
- Date: Sat, 23 Nov 2002 11:32:06 -0000
- Subject: Re: impure_ptr/Mingw and Cygwin
- References: <Pine.LNX.4.21.0211221749200.5472-100000@gremlin.fruitbat.org>
Peter A. Castro <doctor@fruitbat.org> wrote:
> Well, for one thing, linking with -lg will pull in cygwin.dll since
> /lib/libg.a is a symlink to libcygwin.a. So your program won't be
> Cygwin-free, if that's your goal. However, I got it to work with the
> following command:
>
> $ gcc -g foo.c -mno-cygwin -mwindows -o foo -liberty -lmingw32
> $ ./foo.exe > x
> $ cat x
> Hello World
>
> If you change 'stderr' to 'stdout' you get "Hello World 2" in the
> output too. You'll have to play with carriage control a bit, but
> basically it works. Windows doesn't really have the concept of a
> stderr file handle, so this behaviour makes sense to me.
Hmm.... :
$ gcc -g foo.c -mno-cygwin -mwindows -o foo -liberty -lmingw32
$ ./foo.exe > x
Hello World 2
$ cat x
Hello World
How odd. I get the stderr output just fine.
Why the -mwindows -liberty -lmingw32 switches? They are unnecessary.
Max.
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/