有没有办法将STD熄灭控制台?
我想知道是否有Win32功能可以阻止控制台打开。它已经为int winapi wwinmain
输入点功能做到了这一点,但是使用常规int main
输入点功能,控制台本身会打开。我想知道Windows是否具有关闭它的功能。我正在使用llvm clang。
I would like to know if there is a Win32 function to stop the console from opening. It already does this for a int WINAPI wWinMain
entry point function but with the regular int main
entry point function, the console opens by itself. I want to know if Windows has a function to close it. I am using llvm clang.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这可能由编译器控制。
例如,在 gcc文档
-mconsole
如果他想要控制台应用程序或flag-mwindows
如果他想要GUI应用程序,而没有任何控制台。您可能对Microsoft编译器有类似的标志,您可能需要阅读文档。
This might be controlled by the compiler.
For example, in the GCC documentation one can use the flag
-mconsole
if he wants a console application or the flag-mwindows
if he wants a GUI application, without any console.You probably have similar flags for Microsoft Compiler, you might want to read the documentation.
我找到了解决方案。 Linker命令
-wl,/子系统:Windows,/条目:MAINCRTSTARTUP
会告诉它是GUI应用
I found the solution. The linker command
-Wl,/subsystem:windows,/entry:mainCRTStartup
will tell it that it is a GUI app but to use
int main
as the entry point