Sign up

Linking error

Has anyone seen this before? My GTK app used to compile and run, I'm not sure what has changed since:

object.Exception@../../.dub/packages/gtk-d-3.7.3/gtk-d/generated/gtkd/gtkd/Loader.d(125): Library load failed (libgtk-3.0.dylib): dlopen(libgtk-3.0.dylib, 258): Symbol not found: _gdk_quartz_drag_context_get_dragging_info_libgtk_only
  Referenced from: /usr/local/lib/libgtk-3.0.dylib
  Expected in: flat namespace
 in /usr/local/lib/libgtk-3.0.dylib

Re: Linking error

On 26-02-18 17:27, Luís Marques wrote:

Has anyone seen this before? My GTK app used to compile and run, I'm not sure what has changed since:

object.Exception@../../.dub/packages/gtk-d-3.7.3/gtk-d/generated/gtkd/gtkd/Loader.d(125): Library load failed (libgtk-3.0.dylib): dlopen(libgtk-3.0.dylib, 258): Symbol not found: _gdk_quartz_drag_context_get_dragging_info_libgtk_only
   Referenced from: /usr/local/lib/libgtk-3.0.dylib
   Expected in: flat namespace
  in /usr/local/lib/libgtk-3.0.dylib

I've seen a similar error on windows before that happened when an older
version of gtk was listed in the path before the newer version.

What seems to happen is that GtkD loads libgtk-3.0.dylib but when
dlopen then tries to load the libraries gtk depends on it can't find them.

Re: Linking error

On Mon, 26 Feb 2018 23:02:56 +0100, Mike Wey wrote:

On 26-02-18 17:27, Luís Marques wrote:
I've seen a similar error on windows before that happened when an older
version of gtk was listed in the path before the newer version.

What seems to happen is that GtkD loads libgtk-3.0.dylib but when
dlopen then tries to load the libraries gtk depends on it can't find them.

That doesn't seem to be the case in my system, only that dylib exists. As a workaround I just added the symbols to my project:

extern(C) void gdk_quartz_drag_context_get_dragging_info_libgtk_only() {}
extern(C) void gdk_quartz_drag_source_context() {}

They don't seem to be called. I'll have to find out where these symbols are being referenced and understand why they are not present.

Re: Linking error

On 26-02-18 23:22, Luís Marques wrote:

extern(C) void gdk_quartz_drag_context_get_dragging_info_libgtk_only() {}
extern(C) void gdk_quartz_drag_source_context() {}

They don't seem to be called. I'll have to find out where these symbols are being referenced and understand why they are not present.

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.