Allegro question, how can I get rid of the cmd window?

1.5k Views Asked by At

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?

2

There are 2 best solutions below

0
On BEST ANSWER

This really isn't specific to Allegro. The behavior is dependent on your compiler's linker settings.

Under gcc it is:

-Wl,--subsystem,windows

For MSVC:

/SUBSYSTEM:WINDOWS

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.

0
On

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