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?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
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.
回答2:
I just add -mwindows
to linker flags.