Open timotheecour opened 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.
thanks!
_gdk_quartz_drag_context_get_dragging_info_libgtk_only
revealed neither (which is bad since it leads to duplicate bug reports, such as this); but github seems like the more logical place to post bug reportsIn GtkD the static this is used to load the Gtk libraries at runtime.
static this
for similar purposes see https://forum.dlang.org/post/pzktzfezaiiglybokpnj@forum.dlang.org Vibe.d no more using static this() {}
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.
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)
If you don't mind me asking, what is your use case that you link against GtkD but are not actually using it?
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
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
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
/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
static this
somewhere; using static this to load dynamic libraries is fragile, instead libraries should be dynamically loaded on 1st use (I'm not even calling gtkd, just linking to it)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