GNOME Bugzilla – Bug 664027
Build fails with undefined reference to `gdk_keymap_get_modifier_mask'
Last modified: 2011-11-15 05:18:55 UTC
Building current git head in jhbuild fails with GISCAN Gtk-3.0.gir CCLD gtk-query-immodules-3.0 ./.libs/libgtk-3.so: undefined reference to `gdk_keymap_get_modifier_mask' ./.libs/libgtk-3.so: undefined reference to `gdk_modifier_intent_get_type' ./.libs/libgtk-3.so: undefined reference to `gdk_window_begin_resize_drag_for_device' ./.libs/libgtk-3.so: undefined reference to `gdk_event_triggers_context_menu' collect2: ld returned 1 exit status linking of temporary binary failed: Command '['/bin/bash', '../libtool', '--mode=link', '--tag=CC', '--silent', 'gcc', '-o', '/home/martin/upstream/gtk+/gtk/tmp-introspectA8hWZy/Gtk-3.0', '-export-dynamic', '-L.', 'libgtk-3.la', '-pthread', '-L/home/martin-scratch/gnome/lib64', '-lgio-2.0', '-lgobject-2.0', '-lgmodule-2.0', '-lgthread-2.0', '-lrt', '-lglib-2.0', '/home/martin/upstream/gtk+/gtk/tmp-introspectA8hWZy/Gtk-3.0.o']' returned non-zero exit status 1
After fixing gtk/Makefile.am to link gdk in the introspection build, it now fails further on: make[2]: Entering directory `/home/martin/upstream/gtk+/examples' CCLD hello-world CCLD window-default CCLD bloatpad CCLD grid-packing ../gtk/.libs/libgtk-3.so: undefined reference to `gdk_keymap_get_modifier_mask' ../gtk/.libs/libgtk-3.so: undefined reference to `gdk_modifier_intent_get_type' ../gtk/.libs/libgtk-3.so: undefined reference to `gdk_window_begin_resize_drag_for_device' ../gtk/.libs/libgtk-3.so: undefined reference to `gdk_event_triggers_context_menu' collect2: ld returned 1 exit status make[2]: *** [hello-world] Error 1 make[2]: *** Waiting for unfinished jobs.... ../gtk/.libs/libgtk-3.so: undefined reference to `gdk_keymap_get_modifier_mask' ../gtk/.libs/libgtk-3.so: undefined reference to `gdk_modifier_intent_get_type' ../gtk/.libs/libgtk-3.so: undefined reference to `gdk_window_begin_resize_drag_for_device' ../gtk/.libs/libgtk-3.so: undefined reference to `gdk_event_triggers_context_menu' collect2: ld returned 1 exit status ../gtk/.libs/libgtk-3.so: undefined reference to `gdk_keymap_get_modifier_mask' ../gtk/.libs/libgtk-3.so: undefined reference to `gdk_modifier_intent_get_type' ../gtk/.libs/libgtk-3.so: undefined reference to `gdk_window_begin_resize_drag_for_device' ../gtk/.libs/libgtk-3.so: undefined reference to `gdk_event_triggers_context_menu' collect2: ld returned 1 exit status make[2]: *** [grid-packing] Error 1 make[2]: *** [bloatpad] Error 1 ../gtk/.libs/libgtk-3.so: undefined reference to `gdk_keymap_get_modifier_mask' ../gtk/.libs/libgtk-3.so: undefined reference to `gdk_modifier_intent_get_type' ../gtk/.libs/libgtk-3.so: undefined reference to `gdk_window_begin_resize_drag_for_device' ../gtk/.libs/libgtk-3.so: undefined reference to `gdk_event_triggers_context_menu' collect2: ld returned 1 exit status make[2]: *** [window-default] Error 1 make[2]: Leaving directory `/home/martin/upstream/gtk+/examples' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/home/martin/upstream/gtk+' make: *** [all] Error 2 One of the example programs already explictly links with -lgdk, but seems the others now grew a dependency to it as well. As optimizing the libraries for those is not really important, I suggest to just link them all with -lgdk.
Created attachment 201357 [details] [review] Fix GDK linking for Gtk typelib and example builds
Review of attachment 201357 [details] [review]: Makes sense
Committed, thanks for reviewing.