After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 97741 - When i compiled my gtkmm2 program and rut it, it throws segfault
When i compiled my gtkmm2 program and rut it, it throws segfault
Status: RESOLVED NOTABUG
Product: gtkmm
Classification: Bindings
Component: build
2.0
Other Linux
: Normal critical
: ---
Assigned To: gtkmm-forge
gtkmm-forge
Depends on:
Blocks:
 
 
Reported: 2002-11-05 15:43 UTC by nluka
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description nluka 2002-11-05 15:43:48 UTC
I use Anjuta 1.0.0. I started a new gtkmm2.0 project. Then, I copy/paste
the code from my previus source file to the project and compiled it. Then,
when i execudet the program, it sez:
--------------------------------------------
(process:24466): GLib-GObject-CRITICAL **: gtype.c:1806: initialization
assertion failed, use g_type_init() prior to this function

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

(process:24466): Gtk-CRITICAL **: file gtktypeutils.c: line 40
(gtk_type_unique): assertion `GTK_TYPE_IS_OBJECT (parent_type)' failed

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

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

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

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

(process:24466): Gtk-CRITICAL **: file gtktypeutils.c: line 40
(gtk_type_unique): assertion `GTK_TYPE_IS_OBJECT (parent_type)' failed

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

(process:24466): Gtk-CRITICAL **: file gtktypeutils.c: line 40
(gtk_type_unique): assertion `GTK_TYPE_IS_OBJECT (parent_type)' failed
Segmentation fault
---------------------------------------------------------
But when i compiled the previus source files without anjuta 1 and executed
it, it was all ok.

I don't know if this is a Anjuta 1.0 bug or a gtkmm-2 bug.
Comment 1 Murray Cumming 2002-11-05 18:51:28 UTC
This is not a bug report until you supply some simple-as-possible test
code. For general questions, please use the mailing list.

My first guess would be that you haven't use Gtk::Main().
Comment 2 nluka 2002-11-05 21:03:17 UTC
This Example:
/********************************************/
#include <gtkmm.h>

int main(int argc, char *argv[])
{
    Gtk::Window MainWindow;
    Gtk::Button button1("Hello!"); 

    Gtk::Main kit(argc, argv);
	
    MainWindow.set_border_width(10); 
    MainWindow.add(button1);

    Gtk::Main::run(MainWindow);

    return (0);
}
/****************************************/

, compiled with the help of Anjuta 1.0 will generate segfault.
Comment 3 Daniel Elstner 2002-11-06 16:07:51 UTC
You can't instantiate any gtkmm types *before* Gtk::Main has been
instantiated.  If you could we wouldn't have Gtk::Main.