! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
xfdesktop build fails on Ubuntu 13.04 (linking issue with libgdk-x11-2.0.so.0)
Status:
RESOLVED: WORKSFORME
Product:
Xfdesktop
Component:
General

Comments

Description joseph.bylund+bugzilla@gmail.com 2013-03-16 21:49:50 CET
This may in fact be an ubuntu bug, but I didn't know where to file it there.  This is the relevant output of make on my machine

make[3]: Entering directory `/home/jbylund/temp/xfdesktop/settings'
  CC     xfdesktop_settings-main.o
  CCLD   xfdesktop-settings
/usr/bin/ld.bfd.real: ../common/.libs/libxfdesktop.a(libxfdesktop_la-xfdesktop-common.o): undefined reference to symbol 'gdk_keyboard_grab'
/usr/bin/ld.bfd.real: note: 'gdk_keyboard_grab' is defined in DSO /usr/lib/x86_64-linux-gnu/libgdk-x11-2.0.so.0 so try adding it to the linker command line
/usr/lib/x86_64-linux-gnu/libgdk-x11-2.0.so.0: could not read symbols: Invalid operation
collect2: error: ld returned 1 exit status
make[3]: *** [xfdesktop-settings] Error 1
Comment 1 joseph.bylund+bugzilla@gmail.com 2013-03-16 22:21:40 CET
I was able to sort of push it along by adding "`pkg-config --cflags --libs gtk+-2.0`" to the link line.
Comment 2 Eric Koegel editbugs 2013-03-30 17:51:35 CET
Created attachment 4981 
Add compiler/linker flags

Can you see if this patch makes any change? If not, can you attach your config.log? You'll probably want to re-run autogen.sh as well.
Comment 3 joseph.bylund+bugzilla@gmail.com 2013-03-30 18:20:16 CET
Created attachment 4982 
config.log with patch

After applying patch and running autogen build fails with:

make  all-recursive
make[1]: Entering directory `/home/jbylund/temp/xfdesktop'
Making all in backgrounds
make[2]: Entering directory `/home/jbylund/temp/xfdesktop/backgrounds'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `/home/jbylund/temp/xfdesktop/backgrounds'
Making all in common
make[2]: Entering directory `/home/jbylund/temp/xfdesktop/common'
make  all-am
make[3]: Entering directory `/home/jbylund/temp/xfdesktop/common'
make[3]: Nothing to be done for `all-am'.
make[3]: Leaving directory `/home/jbylund/temp/xfdesktop/common'
make[2]: Leaving directory `/home/jbylund/temp/xfdesktop/common'
Making all in doc
make[2]: Entering directory `/home/jbylund/temp/xfdesktop/doc'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `/home/jbylund/temp/xfdesktop/doc'
Making all in po
make[2]: Entering directory `/home/jbylund/temp/xfdesktop/po'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `/home/jbylund/temp/xfdesktop/po'
Making all in settings
make[2]: Entering directory `/home/jbylund/temp/xfdesktop/settings'
make  all-am
make[3]: Entering directory `/home/jbylund/temp/xfdesktop/settings'
  CCLD   xfdesktop-settings
/usr/bin/ld.bfd.real: xfdesktop_settings-main.o: undefined reference to symbol 'gdk_screen_get_monitor_plug_name'
/usr/bin/ld.bfd.real: note: 'gdk_screen_get_monitor_plug_name' is defined in DSO /usr/lib/x86_64-linux-gnu/libgdk-x11-2.0.so.0 so try adding it to the linker command line
/usr/lib/x86_64-linux-gnu/libgdk-x11-2.0.so.0: could not read symbols: Invalid operation
collect2: error: ld returned 1 exit status
make[3]: *** [xfdesktop-settings] Error 1
make[3]: Leaving directory `/home/jbylund/temp/xfdesktop/settings'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/home/jbylund/temp/xfdesktop/settings'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/jbylund/temp/xfdesktop'
make: *** [all] Error 2
Comment 4 Eric Koegel editbugs 2013-04-07 11:39:27 CEST
Created attachment 4992 
Fix linker library order

The config.log does include the library needed.
  I grabbed the xubuntu 13.04 beta 2 image but I didn't encounter the same linker issue you do. I had issues pulling the correct dev packages with beta 1 but it was due to the local mirror not having them yet. 
  Since the order does matter with the linker, this patch may fix the issue... Maybe I need to move the static library below the gtk libraries? I wish I could reproduce it and fix this for you.
  Let me know if this patch works out.
Thanks
Comment 5 joseph.bylund+bugzilla@gmail.com 2013-04-07 22:35:57 CEST
With the patch I get the same error.

Somehow libtool is stripping the gtk libs out of the link line, the call to libtool is:
/bin/bash ../libtool  --tag=CC   --mode=link gcc -I.. -I../common -I../src -pthread -I/usr/local/include/exo-1 -I/usr/local/include/xfce4 -I/usr/include/gtk-2.0 -I/usr/lib/x86_64-linux-gnu/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -I/usr/include/harfbuzz   -pthread -I/usr/local/include/xfce4/libxfce4ui-1 -I/usr/local/include/xfce4 -I/usr/include/gtk-2.0 -I/usr/lib/x86_64-linux-gnu/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -I/usr/include/harfbuzz   -I/usr/include/xfce4/xfconf-0 -I/usr/include/dbus-1.0 -I/usr/lib/x86_64-linux-gnu/dbus-1.0/include -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include   -pthread -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include    -pthread -I/usr/include/pango-1.0 -I/usr/include/cairo -I/usr/include/startup-notification-1.0 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/gtk-2.0 -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -I/usr/lib/x86_64-linux-gnu/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/harfbuzz -I/usr/include/libwnck-1.0   -DG_LOG_DOMAIN=\"xfdesktop-settings\" -DEXO_API_SUBJECT_TO_CHANGE -DWNCK_I_KNOW_THIS_IS_UNSTABLE -DLOCALEDIR=\"/usr/local/share/locale\" -DDATADIR=\"/usr/local/share\" -DBINDIR=\"/usr/local/bin\" -g -O2   -o xfdesktop-settings xfdesktop_settings-main.o ../common/libxfdesktop.la  -pthread -lgthread-2.0 -lglib-2.0   -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgio-2.0 -lpangoft2-1.0 -lpangocairo-1.0 -lgdk_pixbuf-2.0 -lcairo -lpango-1.0 -lfreetype -lfontconfig -lgobject-2.0 -lglib-2.0   -lxfconf-0 -ldbus-glib-1 -ldbus-1 -lgobject-2.0 -lglib-2.0   -L/usr/local/lib -lxfce4ui-1 -lgtk-x11-2.0 -lxfce4util -lgdk-x11-2.0 -latk-1.0 -lgio-2.0 -lpangoft2-1.0 -lpangocairo-1.0 -lgdk_pixbuf-2.0 -lcairo -lpango-1.0 -lfreetype -lfontconfig -lgobject-2.0 -lglib-2.0   -L/usr/local/lib -lexo-1 -lgtk-x11-2.0 -lxfce4util -lgdk-x11-2.0 -latk-1.0 -lgio-2.0 -lpangoft2-1.0 -lpangocairo-1.0 -lgdk_pixbuf-2.0 -lcairo -lpango-1.0 -lfreetype -lfontconfig -lgobject-2.0 -lglib-2.0   -lwnck-1 -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgio-2.0 -lpangoft2-1.0 -lpangocairo-1.0 -lgdk_pixbuf-2.0 -lcairo -lpango-1.0 -lfreetype -lfontconfig -lgobject-2.0 -lglib-2.0   -lSM -lICE -lX11

And libtool's output (call) is:
libtool: link: gcc -I.. -I../common -I../src -pthread -I/usr/local/include/exo-1 -I/usr/local/include/xfce4 -I/usr/include/gtk-2.0 -I/usr/lib/x86_64-linux-gnu/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -I/usr/include/harfbuzz -pthread -I/usr/local/include/xfce4/libxfce4ui-1 -I/usr/local/include/xfce4 -I/usr/include/gtk-2.0 -I/usr/lib/x86_64-linux-gnu/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -I/usr/include/harfbuzz -I/usr/include/xfce4/xfconf-0 -I/usr/include/dbus-1.0 -I/usr/lib/x86_64-linux-gnu/dbus-1.0/include -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -pthread -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -pthread -I/usr/include/pango-1.0 -I/usr/include/cairo -I/usr/include/startup-notification-1.0 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/gtk-2.0 -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -I/usr/lib/x86_64-linux-gnu/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/harfbuzz -I/usr/include/libwnck-1.0 -DG_LOG_DOMAIN=\"xfdesktop-settings\" -DEXO_API_SUBJECT_TO_CHANGE -DWNCK_I_KNOW_THIS_IS_UNSTABLE -DLOCALEDIR=\"/usr/local/share/locale\" -DDATADIR=\"/usr/local/share\" -DBINDIR=\"/usr/local/bin\" -g -O2 -o xfdesktop-settings xfdesktop_settings-main.o -pthread  ../common/.libs/libxfdesktop.a /usr/lib/x86_64-linux-gnu/libgthread-2.0.so -lxfconf-0 -ldbus-glib-1 -ldbus-1 -L/usr/local/lib /usr/local/lib/libxfce4ui-1.so /usr/local/lib/libexo-1.so /usr/local/lib/libxfce4util.so -lwnck-1 /usr/lib/libgtk-x11-2.0.so /usr/lib/x86_64-linux-gnu/libatk-1.0.so /usr/lib/x86_64-linux-gnu/libgio-2.0.so /usr/lib/x86_64-linux-gnu/libpangoft2-1.0.so /usr/lib/x86_64-linux-gnu/libpangocairo-1.0.so -lgdk_pixbuf-2.0 /usr/lib/x86_64-linux-gnu/libcairo.so /usr/lib/x86_64-linux-gnu/libpango-1.0.so /usr/lib/x86_64-linux-gnu/libfreetype.so -lfontconfig /usr/lib/x86_64-linux-gnu/libgobject-2.0.so /usr/lib/x86_64-linux-gnu/libglib-2.0.so -lSM -lICE -lX11 -pthread

Which seems to be missing most of `pkg-config --libs gtk+-2.0` (which is sufficient to add to the gcc call of libtool to get it to go).  Also, libtool has a "link_all_deplibs", and setting that to true is sufficient to get the setting binary to compile, of course I imagine there was a reason why it's set to no.
Comment 6 joseph.bylund+bugzilla@gmail.com 2013-04-09 21:23:17 CEST
Eric,
It ended up being faster to reinstall my system than try to figure it out.  Cannot repro now, so closing.  Can reopen if necessary.  Thanks for taking a look.
-Joe

Bug #9926

Reported by:
joseph.bylund+bugzilla@gmail.com
Reported on: 2013-03-16
Last modified on: 2013-04-09

People

Assignee:
Eric Koegel
CC List:
2 users

Version

Version:
Unspecified

Attachments

Add compiler/linker flags (1014 bytes, patch)
2013-03-30 17:51 CET , Eric Koegel
no flags
config.log with patch (63.88 KB, text/x-log)
2013-03-30 18:20 CET , joseph.bylund+bugzilla@gmail.com
no flags
Fix linker library order (806 bytes, patch)
2013-04-07 11:39 CEST , Eric Koegel
no flags

Additional information