Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
timotheecour opened this issue Mar 6, 2018 · 8 comments

Comments

@timotheecour
Copy link
Contributor

timotheecour commented Mar 6, 2018

/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

  • also, I'm guessing this is coming from using 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

@MikeWey
Copy link
Member

MikeWey commented Mar 6, 2018

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
Copy link
Contributor Author

thanks!

  • are bugs best reported on github or https://forum.gtkd.org ? google search for _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 reports

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

@MikeWey
Copy link
Member

MikeWey commented Mar 6, 2018

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
Copy link
Contributor Author

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
Copy link
Member

MikeWey commented Mar 8, 2018

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

@timotheecour
Copy link
Contributor Author

timotheecour commented Mar 9, 2018

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
Copy link
Contributor Author

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
Copy link
Contributor Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants