如何阻止使用 MinGW (g++) 编译的程序在 Windows 中打开控制台窗口 [英] How to stop a program compiled with MinGW (g++) from opening a console window in windows
本文介绍了如何阻止使用 MinGW (g++) 编译的程序在 Windows 中打开控制台窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我使用 MinGW g++ 编译了一个程序.当我运行它时,除了主应用程序窗口之外,它还会打开一个控制台窗口.阻止这个的编译器标志是什么?
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?
推荐答案
我相信编译器开关是-Wl,-subsystem,windows
.
-Wl,
开关将
传递给链接器.-subsystem
开关告诉链接器在生成可执行文件时要针对哪个系统.
The -Wl,<options>
switch passes <options>
to the linker. The -subsystem
switch tells the linker which system to target when generating the executable.
这篇关于如何阻止使用 MinGW (g++) 编译的程序在 Windows 中打开控制台窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文