This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: impure_ptr/Mingw and Cygwin


On Sun, 24 Nov 2002, Max Bowsher wrote:

> Peter A. Castro <doctor@fruitbat.org> wrote:
> 
> > On Sat, 23 Nov 2002, Max Bowsher wrote:
> >> $ 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).
> 
> -liberty ? Not on my computer.

iberty just provides extra functions which might be missing from a given
environment.  It's strictly not needed, but doesn't hurt either. 

> -lmingw32 ? I think that's just one of the redundant things libtool like to
> add.

This really has nothing to do with libtool.  Try adding that '-v' option
to the command line and look at the list of libraries being pulled in by
the compiler.  Since the compiler pulls in mingw32 implicitly from the
-mno-cygwin flag you can leave this library off. 

> -mwindows ? Sparsely documented, if at all. I *think* it is to link as a
> Windows GUI exe rather than a Windows console exe.

Yep.  Adds flags to the linker to pull in windows GUI libraries and
possibly determine which startup object to use (console vs GUI vs ...)

> So, I think you can lose all 3 of these.

Depends on what he's coding for.  I was under the impression from other
email that he might need more than the bare minimum that foo.c represents.
If it's likely to have graphics in it, then I'd leave the -mwindows and
he can always add -liberty back in if things don't resolve.

However, his current problem is that he still gets references to
_impure_ptr which doesn't make sense, since that would really only be
generated if he compiled without -mno-cygwin, and he claims he has
recompiled with it.

> --
> Max.

-- 
Peter A. Castro <doctor@fruitbat.org> or <Peter.Castro@oracle.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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]