[gtkmm] A strange segfault



I recently installed Slackware 10.0 with GCC 3.4 + GNOME 2.6.3(shipped with
Slack). Then I installed gtkmm 2.4.3, glibmm 2.4.3 and libsigc++ 2.0.3 with
--prefix=/usr(also tried with the default /usr/local).

I compile a simple GTKmm application:

------------------------------------
#include <gtkmm.h>

int main(int argc, char **argv)
{
	Gtk::Window *main_window = new Gtk::Window;
	Gtk::Button *button1 = new Gtk::Button;
	Gtk::Main kit(argc, argv);

	main_window->add(*button1);
	main_window->show_all();

	Gtk::Main::run(*main_window);
	return 0;
}
------------------------------------
$ g++ test.cpp `pkg-config --libs --cflags gtkmm-2.4` -o test

And when I run the program:
------------------------------------
luka luka:~$ ./test

(process:3731): GLib-GObject-CRITICAL **: gtype.c:2253: initialization assertion
failed, use g_type_init() prior to this function

(process:3731): GLib-GObject-CRITICAL **: gtype.c:2253: initialization assertion
failed, use g_type_init() prior to this function

(process:3731): GLib-GObject-CRITICAL **: gtype.c:2253: initialization assertion
failed, use g_type_init() prior to this function

(process:3731): GLib-GObject-CRITICAL **: file gtype.c: line 2319
(g_type_add_interface_static): assertion `G_TYPE_IS_INSTANTIATABLE
(instance_type)' failed

(process:3731): GLib-GObject-CRITICAL **: gtype.c:2253: initialization assertion
failed, use g_type_init() prior to this function

(process:3731): GLib-GObject-CRITICAL **: gtype.c:2253: initialization assertion
failed, use g_type_init() prior to this function

(process:3731): GLib-GObject-CRITICAL **: gtype.c:2253: initialization assertion
failed, use g_type_init() prior to this function
Segmentation fault
luka luka:~$
------------------------------------

What did I do wrong? I also wrote the program with no pointers and dynamic
allocation but it's the same thing. Please help!

Greets,
Luka

____________________
http://www.email.si/



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]