Allegro 问题,如何摆脱 cmd 窗口?
我在 Allegro 中制作了一个小游戏,但每次运行 .exe 文件时,它都会打开图形的 allegro 窗口,还会打开命令行窗口,即使我没有打印任何内容。
cmd窗口放在游戏窗口旁边有点难看,所以我想知道有什么办法不显示它吗?
I've made a small game in Allegro, but every time I run the .exe file it opens both the allegro window for the graphics but also a command line window even though I don't have anything that prints to it.
It's kind ugly to have the cmd window next to the game window, so I wonder is there any way to not show it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这确实不是 Allegro 特有的。该行为取决于编译器的链接器设置。
在 gcc 下是:
对于 MSVC:
如果您使用 IDE,请查看链接器设置下的某个位置。它也可能被称为“控制台”与“Windows(或 GUI)应用程序”之类的东西。你会想要后者。
This really isn't specific to Allegro. The behavior is dependent on your compiler's linker settings.
Under gcc it is:
For MSVC:
If you use an IDE, look somewhere under the linker settings. It may also be referred to as something like "console" vs "windows (or GUI) application." You'll want the latter.
以下是 Visual Studio Community 2022 中针对 C++ 的特定解决方案。
右键单击具有入口点的项目,然后选择“属性”。在“Linker”和“System”下,将名为“SubSystem”的行更改为“
Windows (/SUBSYSTEM:WINDOWS)
”来源:https://www.allegro.cc/forums/thread/607888
Here is a specific solution for C++ in Visual Studio Community 2022.
Right click on the project with you entry point and select "Properties". Under "Linker" and "System", change the row named "SubSystem" into "
Windows (/SUBSYSTEM:WINDOWS)
"Source: https://www.allegro.cc/forums/thread/607888