I am compiling Gtk applications in Windows with MinGW toolchain, but when I run my apps, a command prompt window appears. How can I make this prompt disappear?
Asked
Active
Viewed 3,366 times
2 Answers
14
Check this article out. You have to specify -mwindows at compile time.

NG.
- 22,560
- 5
- 55
- 61
-
1If you change "might have to" to "definitely have to", I'll give you a point. It's the only way to do it (except for hacks). – Matthew Talbert Feb 17 '10 at 18:49
1
If you're using Meson (>= 0.56.0), you can set win_subsystem
kwarg to windows
, in such commands as executable()
, library()
, and many others.
For instance:
executable(
'app-gui',
files(['main.cpp']),
dependencies: [dependency('gtkmm-4.0')],
include_directories: include_directories('include'),
win_subsystem: 'windows'
)
Tip: Meson would only use the option for cross-compilation and not native builds, so no need to check for anything (e.g. meson.is_cross_build()
is unnecessary).

MAChitgarha
- 3,728
- 2
- 33
- 40