Re: Compilation error with xml



On Sun, Jun 04, 2006 at 01:46:25AM +0200, Guillaume Ruch wrote:
When I try to compile my libglade2 program with :
...
I get the following errors :

(prog1:27396): GLib-GObject-WARNING **: specified class size for type `GtkData' is smaller than
the parent type's `GtkObject' class size
...

I cannot see any code posted, however a crystall ball tells
me the problem is in the definition of GtkData which lacks
the parent object (GtkObject) as its first member, or the
parent object member is wrong.  See the GObject tutorial
http://developer.gnome.org/doc/API/2.0/gobject/chapter-gobject.html
how parent types and classes are included.

BTW calling your type GtkData is not a good idea.  What will
happen if the next version of Gtk+ introduces a GtkData
type too?

Yeti


Hi,
Thanks for your answer but I think the problem is somewhere else... When I try to compile a very
minimal program like :

#include <stdio.h>
#include <gtk-2.0/gtk/gtk.h>
#include <libglade-2.0/glade/glade.h>


void on_button1_clicked(GtkWidget *widget, gpointer data)
{
  printf("Bouton 1");
}

void on_MainWindow_destroy(GtkWidget *widget, gpointer data)
{
  gtk_main_quit();
}

int main(int argc, char **argv)
{
    GladeXML *xml;
    GtkWidget *widget;

    gtk_init(&argc, &argv);
    xml = glade_xml_new("../prog1.glade", NULL, NULL);

    widget = glade_xml_get_widget(xml, "prog_main");

     glade_xml_signal_autoconnect(xml);

    gtk_main();
    return 0;
}

I get the same errors (the interface is just a button on a window...)

Perhaps my compiling command is not good ? : gcc -o prog1 prog1.c `pkg-config --cflags --libs
gtk+-2.0` `libglade-config --libs gnome`  -lxml -export-dynamic

I think it's an xml error because it works well without the glade_xml_signal_autoconnect. (Just
say that signals are not connected ;-)

G.Ruch





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