How to stop a program compiled with MinGW (g++) from opening a console window in windows

前端 未结 2 1133
终归单人心
终归单人心 2020-11-27 06:16

I compiled a program using MinGW g++. When I run it, it opens a console window in addition to the main application window. What\'s the compiler flag to stop this?

相关标签:
2条回答
  • 2020-11-27 06:35

    I just add -mwindows to linker flags.

    0 讨论(0)
  • 2020-11-27 06:51

    I believe the compiler switch for that is -Wl,-subsystem,windows.

    The -Wl,<options> switch passes <options> to the linker. The -subsystem switch tells the linker which system to target when generating the executable.

    0 讨论(0)
提交回复
热议问题