delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2002/11/24/12:41:49

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Date: Sun, 24 Nov 2002 09:39:28 -0800 (PST)
From: "Peter A. Castro" <doctor AT fruitbat DOT org>
To: Max Bowsher <maxb AT ukf DOT net>
cc: Andrew DeFaria <ADeFaria AT Salira DOT com>, cygwin AT cygwin DOT com
Subject: Re: impure_ptr/Mingw and Cygwin
In-Reply-To: <005b01c292e3$f39e1410$78d96f83@pomello>
Message-ID: <Pine.LNX.4.21.0211240935060.7231-100000@gremlin.fruitbat.org>
MIME-Version: 1.0

On Sat, 23 Nov 2002, Max Bowsher wrote:

> Peter A. Castro <doctor AT fruitbat DOT 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.

Yes, very interesting.  I'll have to see if perhaps stderr output is
appearing and the command prompt is simple overlaying it after the
command returns.  BTW, I was running the program from a regular DOS
Prompt, not a bash shell (not that that should make a big difference for
console I/O). 

> Why the -mwindows -liberty -lmingw32 switches? They are unnecessary.

Because that's how setup.exe is built (that's where I got the above
switches from).

> Max.

-- 
Peter A. Castro <doctor AT fruitbat DOT org> or <Peter DOT Castro AT oracle DOT com>
	"Cats are just autistic Dogs" -- Dr. Tony Attwood


--
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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019