-mwindows command line option for g++

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

-mwindows command line option for g++

youda008
Hi.
Can anyone explain me, what a g++ command line option "-mwindows" does? My IDE CodeBlocks adds it to the flags when compiling a project for some reason, and it ruins the final program. When i write a custom Makefile and delete this option, application works.

------------------------------------------------------------------------------

_______________________________________________
MinGW-users mailing list
[hidden email]

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Also: mailto:[hidden email]?subject=unsubscribe
Reply | Threaded
Open this post in threaded view
|

Re: -mwindows command line option for g++

Paul Moore
On 27 July 2015 at 16:33,  <[hidden email]> wrote:
> Can anyone explain me, what a g++ command line option "-mwindows" does? My
> IDE CodeBlocks adds it to the flags when compiling a project for some
> reason, and it ruins the final program. When i write a custom Makefile and
> delete this option, application works.

-mwindows makes the executable a GUI-subsystem executable. Without it,
it's a console-subsystem executable.

Paul

------------------------------------------------------------------------------
_______________________________________________
MinGW-users mailing list
[hidden email]

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Also: mailto:[hidden email]?subject=unsubscribe
Reply | Threaded
Open this post in threaded view
|

Re: -mwindows command line option for g++

Eli Zaretskii
In reply to this post by youda008
> From: <[hidden email]>
> Date: Mon, 27 Jul 2015 17:33:35 +0200 (CEST)
>
> Can anyone explain me, what a g++ command line option "-mwindows" does? My IDE
> CodeBlocks adds it to the flags when compiling a project for some reason, and
> it ruins the final program. When i write a custom Makefile and delete this
> option, application works.

>From the GCC manual:

  `-mwindows'
       This option is available for Cygwin and MinGW targets.  It
       specifies that a GUI application is to be generated by instructing
       the linker to set the PE header subsystem type appropriately.


------------------------------------------------------------------------------
_______________________________________________
MinGW-users mailing list
[hidden email]

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Also: mailto:[hidden email]?subject=unsubscribe
Reply | Threaded
Open this post in threaded view
|

Re: -mwindows command line option for g++

Gisle Vanem-2
Eli Zaretskii wrote:

 >    `-mwindows'
>         This option is available for Cygwin and MinGW targets.  It
>         specifies that a GUI application is to be generated by instructing
>         the linker to set the PE header subsystem type appropriately.

Is this the exactly the same as '-Wl,--subsystem,windows' at
the link-stage?

I mean, why should there be need for a '-mwindows' at both the
compile and the link-stage? Another case of gcc option bloat?
Just curious. I prefer the '-Wl' form; clearer what it does IMHO.

--
--gv

------------------------------------------------------------------------------
_______________________________________________
MinGW-users mailing list
[hidden email]

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Also: mailto:[hidden email]?subject=unsubscribe
Reply | Threaded
Open this post in threaded view
|

Re: -mwindows command line option for g++

Eli Zaretskii
> Date: Mon, 27 Jul 2015 17:58:07 +0200
> From: Gisle Vanem <[hidden email]>
>
> Eli Zaretskii wrote:
>
>  >    `-mwindows'
> >         This option is available for Cygwin and MinGW targets.  It
> >         specifies that a GUI application is to be generated by instructing
> >         the linker to set the PE header subsystem type appropriately.
>
> Is this the exactly the same as '-Wl,--subsystem,windows' at
> the link-stage?

No, it also adds a few additional libraries, such as gdi32 and
comdlg32, to the list it passes to the linker.  See the specs (as in
"gcc -dumpspecs").

------------------------------------------------------------------------------
_______________________________________________
MinGW-users mailing list
[hidden email]

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Also: mailto:[hidden email]?subject=unsubscribe