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

拥有回忆 提交于 2019-12-27 14:44:09

问题


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.



来源:https://stackoverflow.com/questions/4441551/how-to-stop-a-program-compiled-with-mingw-g-from-opening-a-console-window-in

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!