user247282
user247282

Reputation:

How to hide command prompt for my Windows Gtk Apps?

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?

Upvotes: 9

Views: 3590

Answers (2)

MAChitgarha
MAChitgarha

Reputation: 4288

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).

Upvotes: 1

NG.
NG.

Reputation: 22904

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

Upvotes: 14

Related Questions