9

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?

2 Answers2

14

Check this article out. You have to specify -mwindows at compile time.

NG.
  • 22,560
  • 5
  • 55
  • 61
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