gtkd-developers / GtkD

GtkD is a D binding and OO wrapper of GTK+ originally created by Antonio Monteiro
http://gtkd.org
Other
321 stars 71 forks source link

generated/gtkd/gtkd/Loader.d(125): Library load failed (libgtk-3.0.dylib) #232

Open timotheecour opened 6 years ago

timotheecour commented 6 years ago

/cc @MikeWey after I called brew upgrade on OSX I got:

GtkD/generated/gtkd/gtkd/Loader.d(125): Library load failed (libgtk-3.0.dylib): dlopen(/Users/timothee/homebrew//lib/libgtk-3.0.dylib, 258): Symbol not found: _gdk_quartz_drag_context_get_dragging_info_libgtk_only Referenced from: /Users/timothee/homebrew//lib/libgtk-3.0.dylib

looks like gtk 3.22.28 doesn't work.

WORKAROUND

brew switch gtk+3 3.22.26 but this won't last, brew doesn't keep around old versions for long

MikeWey commented 6 years ago

In GtkD the static this is used to load the Gtk libraries at runtime. From what i can tell the following is happening:

The static this in GtkD uses dlopen to load the gtk3 dylib, dlopen loads the gtk3 dylib and the dylibs it depends on. and for some reason it can't find the quartz drag and drop symbols in the gdk dylib.

GtkD throws an error when you call a function that can't be found in the loaded libraries.

See Also: https://forum.gtkd.org/groups/GtkD/thread/732/

timotheecour commented 6 years ago

thanks!

In GtkD the static this is used to load the Gtk libraries at runtime.

MikeWey commented 6 years ago

Bug are best reported on github.

As for loading on first use that is probably possible, though won't help with the issue at hand. We are also moving more in the other direction (at least on linux), where we want to link to the gtk shared libraries at compile time, and stop using the static this all together. So libgtkd-3.so would depend on libgtk-3.so directly.

timotheecour commented 6 years ago

though won't help with the issue at hand

well it would fix issue of someone linking against gtkd but not calling it (so error would only occur when calling a function that requires gtk libraries)

MikeWey commented 6 years ago

If you don't mind me asking, what is your use case that you link against GtkD but are not actually using it?

timotheecour commented 6 years ago

https://forum.gtkd.org/groups/GtkD/thread/732/


They are referenced from the quartz drag and drop implementation of GTK+.

https://github.com/GNOME/gtk/blob/1a9a0c25771d124a54b8bf7d81e36033ba429970/gtk/gtkdnd-quartz.c#L172 https://github.com/GNOME/gtk/blob/1a9a0c25771d124a54b8bf7d81e36033ba429970/gtk/gtkdnd-quartz.c#L231

And they are defined in the Gdk quartz backend, so i don't know why they aren't found.


see below: t vs T

nm $homebrew_D/Cellar/gtk+3/3.22.26/lib/libgdk-3.0.dylib | grep gdk_quartz_drag_context_get_dragging_info_libgtk_only 0000000000032832 T _gdk_quartz_drag_context_get_dragging_info_libgtk_only

nm $homebrew_D/Cellar/gtk+3/3.22.28/lib/libgdk-3.0.dylib | grep gdk_quartz_drag_context_get_dragging_info_libgtk_only 000000000003287e t _gdk_quartz_drag_context_get_dragging_info_libgtk_only

timotheecour commented 6 years ago

If you don't mind me asking, what is your use case that you link against GtkD but are not actually using it?

i have a top-level binary that does a lot of things but only calls into gtkd when specified with the right command line arguments. So I'd like it to only break when explicitly calling gtkd code that breaks, not when merely calling the binary

timotheecour commented 6 years ago

I reported it here: https://bugs.launchpad.net/inkscape/+bug/1754734 REG: gdk_quartz_drag_context_get_dragging_info_libgtk_only not exported anymore Edit