This is the mail archive of the cygwin 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: -mwindows and --Wl,subsystem,windows

Andy Koppe wrote:
> According to this post on the gcc mailing list a few years back, gcc's
> -mwindows option should imply --Wl,subsystem,windows:

   Yep, it still does.

> I find, however, that I'm getting different behaviour when passing
> --Wl,subsystem,windows explicitly. (Without it, stdout from mintty
> opens a console, but with it, the output ends up in the mintty window
> itself. No idea how the latter comes about.)

  Besides adding the subsystem option, -mwindows does a bit more besides,
adding "-lgdi32 -lcomdlg32" to the link command-line.  That's probably not
relevant here though.

> What is the intended behaviour for -mwindows, and should it be used at all?

  It should be used when you want a GUI application rather than a console
application, i.e. one that's going to have a window and pump windows messages.

  It's not entirely surprising that you'd get no console when you add it to
the command-line.  (If you need both a console - maybe hidden - and a win32
message loop as well, I think you can make a GUI app that calls AllocConsole
at runtime.)


Unsubscribe info:
Problem reports:

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