jhass / crystal-gobject

gobject-introspection for Crystal
BSD 3-Clause "New" or "Revised" License
126 stars 13 forks source link

Undefined constant LibGObject::ObjectClass (Gtk 4 compat) #35

Closed valpackett closed 4 years ago

valpackett commented 4 years ago

Next problem after #33 was fixed:

Called macro defined in lib/gobject/gobject.cr:7:1

 7 | macro require_gobject(namespace)

Which expanded to:

 > 6463 | fun editable_delegate_get_property = gtk_editable_delegate_get_property(object : LibGObject::Object*, prop_id : UInt32, value : LibGObject::Value*, pspec : LibGObject::ParamSpec*) : Bool
 > 6464 | fun editable_delegate_set_property = gtk_editable_delegate_set_property(object : LibGObject::Object*, prop_id : UInt32, value : LibGObject::Value*, pspec : LibGObject::ParamSpec*) : Bool
 > 6465 | fun editable_install_properties = gtk_editable_install_properties(object_class : LibGObject::ObjectClass*, first_prop : UInt32) : UInt32
                                                                                           ^----------------------
Error: undefined constant LibGObject::ObjectClass

(gtk3-3.24.10)

jhass commented 4 years ago

This happens doing what exactly? I cannot reproduce when running the samples using glib 2.62.4 (which gobject is part of). My Gtk version is 3.24.12 fwiw.

valpackett commented 4 years ago

Just anything like crystal run samples/gtk_entry.cr.

So turns out this is actually coming from gtk4:

~ % rg gtk_editable_install_properties /usr/local/share/gir-1.0
/usr/local/share/gir-1.0/Gtk-4.0.gir
31650:In your class_init function, call gtk_editable_install_properties(),
31659:   gtk_editable_install_properties (object_clas, NUM_PROPERTIES);
31810:                c:identifier="gtk_editable_install_properties">
151041:              c:identifier="gtk_editable_install_properties"

so it really is just trying to generate everything.

jhass commented 4 years ago

Not everything but the latest versions. I don't have Gtk 4 yet, so that might explain why I can't reproduce and why it might have new dependencies now etc.