Re: [gtkmm] simple libglademm program barfs telling me to call g_type_init()



> #include <libglademm.h>
> 
> int main(int argc,char *argv[])
> {
>   Glib::RefPtr<Gnome::Glade::Xml> refXml =
> Gnome::Glade::Xml::create("gic2.glade");
> }
> 

You need to create a Gtk::Main object, like this:

int main(int argc, char** argv) {
    Gtk::Main main(argc, argv);
    ...
}

This takes care of calling gtk_init(), etc.

cheers,
--
joey yandle







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