After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 664027 - Build fails with undefined reference to `gdk_keymap_get_modifier_mask'
Build fails with undefined reference to `gdk_keymap_get_modifier_mask'
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: .General
3.3.x
Other Linux
: Normal major
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2011-11-14 12:04 UTC by Martin Pitt
Modified: 2011-11-15 05:18 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Fix GDK linking for Gtk typelib and example builds (1.83 KB, patch)
2011-11-14 12:16 UTC, Martin Pitt
committed Details | Review

Description Martin Pitt 2011-11-14 12:04:34 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
Comment 1 Martin Pitt 2011-11-14 12:15:29 UTC
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.
Comment 2 Martin Pitt 2011-11-14 12:16:46 UTC
Created attachment 201357 [details] [review]
Fix GDK linking for Gtk typelib and example builds
Comment 3 Matthias Clasen 2011-11-15 04:50:41 UTC
Review of attachment 201357 [details] [review]:

Makes sense
Comment 4 Martin Pitt 2011-11-15 05:18:55 UTC
Committed, thanks for reviewing.