Back

Fix for "initialization assertion failed, use IA__g_type_init() prior to this function"

Problem:
I received a bunch of "initialization assertion failed, use IA__g_type_init() prior to this function" message while running GTK-2.0 based program.

Solution:
Add call to Gtk::Main m(argc, argv) in the very beginning or your program:
#include <glib.h>
int main(int argc, char **argv)
{
   printf("printf:main()\n"); // One type of debug output into associated console
   g_print("g_print:main()\n"); // Another type of debug output
 
   Gtk::Main m(argc, argv);
 
   (your code here)
}