How to get rid of the console when writing GUI programs using gtk in C?

I follow the tutorial:

http://zetcode.com/tutorials/gtktutorial/firstprograms/

This works, but every time I double-click on the executable, there is a console in which I do not want it there.

How do I get rid of this console?

Platform: Windows XP.

By the way, I also have this problem when right-clicking on the icon:

GLib-WARNING **: g_main_context_check() called recursively from within a source check() or prepare() member. 

Anyone familiar with this?

+4
source share
2 answers

When connecting, use the -mwindows argument

 gcc -o simple simple.c `pkg-config --libs --cflags gtk+-2.0` -mwindows 
+5
source

The console opens, then the application displays the text (which may have been obvious). By default, the application displays text, then an error occurs. Use g_set_printerr_handler () to change this behavior (to display an error dialog box, write to a file, or whatever).

-1
source

Source: https://habr.com/ru/post/1308576/


All Articles