Re: [gtkmm] A strange segfault



On Mon, 2004-06-28 at 15:20 +0200, Luka Napotnik wrote:
> 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);

Instantiate Gtk::Main before you use any gtkmm widgets. You will see
this in the examples.

> 
> 	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/
> _______________________________________________
> gtkmm-list mailing list
> gtkmm-list gnome org
> http://mail.gnome.org/mailman/listinfo/gtkmm-list




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