GNOME Bugzilla – Bug 313368
linking failure in gswitchit build
Last modified: 2005-08-24 00:03:08 UTC
Distribution/Version: Fedora Core 4 gnome-applets is failing to build as part of jhbuild for me. I get the following error: /bin/sh ../libtool --tag=CC --mode=link gcc -g -O2 -o gnome-keyboard-applet gnome_keyboard_applet-switch.o -L/opt/gnome2/lib -lxklavier -lxml2 -lz -lm -L/opt/gnome2/lib -lglade-2.0 -lgtk-x11-2.0 -lxml2 -lgdk-x11-2.0 -latk-1.0 -lgdk_pixbuf-2.0 -lm -lpangocairo-1.0 -lpango-1.0 -lfreetype -lz -lcairo -lgobject-2.0 -lgmodule-2.0 -ldl -lglib-2.0 -L/usr/X11R6/lib -lSM -lICE -lX11 -pthread -L/opt/gnome2/lib -L/usr/X11R6/lib -lpanel-applet-2 -lgnomeui-2 -lSM -lICE -lbonoboui-2 -lxml2 -lgnomecanvas-2 -lgnome-2 -lpopt -lart_lgpl_2 -lpangoft2-1.0 -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgdk_pixbuf-2.0 -lpangocairo-1.0 -lpango-1.0 -lfreetype -lz -lcairo -lgobject-2.0 -lgnomevfs-2 -lbonobo-2 -lgconf-2 -lbonobo-activation -lORBit-2 -lm -lgmodule-2.0 -ldl -lgthread-2.0 -lglib-2.0 ../gswitchit/libgswitchit-applet.a ../libgswitchit/libgswitchit.a ../libkbdraw/libkbdraw.a gcc -g -O2 -o gnome-keyboard-applet gnome_keyboard_applet-switch.o -pthread -L/opt/gnome2/lib /opt/gnome2/lib/libxklavier.so -lxkbfile -L/usr/X11R6/lib /opt/gnome2/lib/libpanel-applet-2.so -L/usr/kerberos/lib /opt/gnome2/lib/libglade-2.0.so /opt/gnome2/lib/libgnomeui-2.so /opt/gnome2/lib/libgnome-keyring.so /usr/lib/libjpeg.so /opt/gnome2/lib/libbonoboui-2.so -lSM -lICE /opt/gnome2/lib/libgnomecanvas-2.so /opt/gnome2/lib/libgnome-2.so /opt/gnome2/lib/libesd.so -lasound /opt/gnome2/lib/libaudiofile.so /opt/gnome2/lib/libart_lgpl_2.so /opt/gnome2/lib/libgtk-x11-2.0.so /opt/gnome2/lib/libgdk-x11-2.0.so /opt/gnome2/lib/libatk-1.0.so /opt/gnome2/lib/libgdk_pixbuf-2.0.so /opt/gnome2/lib/libpangocairo-1.0.so /opt/gnome2/lib/libpangoft2-1.0.so /opt/gnome2/lib/libpango-1.0.so /opt/gnome2/lib/libcairo.so /opt/gnome2/lib/libXrender.so -lX11 -lpng12 /opt/gnome2/lib/libfontconfig.so /usr/lib/libexpat.so /usr/lib/libfreetype.so /opt/gnome2/lib/libgnomevfs-2.so /opt/gnome2/lib/libxml2.so -lssl -lcrypto -lgssapi_krb5 -lkrb5 -lcom_err -lk5crypto -lz /opt/gnome2/lib/libhowl -lresolv -lrt /opt/gnome2/lib/libbonobo-2.so /opt/gnome2/lib/libgconf-2.so /opt/gnome2/lib/libbonobo-activation.so /opt/gnome2/lib/libORBitCosNaming-2.so /opt/gnome2/lib/libORBit-2.so /usr/lib/libpopt.so /opt/gnome2/lib/libgobject-2.0.so -lm /opt/gnome2/lib/libgmodule-2.0.so -ldl /opt/gnome2/lib/libgthread-2.0.so -lpthread /opt/gnome2/lib/libglib-2.0.so ../gswitchit/libgswitchit-applet.a ../libgswitchit/libgswitchit.a ../libkbdraw/libkbdraw.a -Wl,--rpath -Wl,/opt/gnome2/lib -Wl,--rpath -Wl,/opt/gnome2/lib ../libkbdraw/libkbdraw.a(keyboard-drawing.o)(.text+0x5ed): In function `draw_layout': /home/mdrago/rpmbuild/BUILD/gnome-applets/libkbdraw/keyboard-drawing.c:666: undefined reference to `pango_xft_set_default_substitute' ../libkbdraw/libkbdraw.a(keyboard-drawing.o)(.text+0x5fe):/home/mdrago/rpmbuild/BUILD/gnome-applets/libkbdraw/keyboard-drawing.c:670: undefined reference to `pango_xft_substitute_changed' ../libkbdraw/libkbdraw.a(keyboard-drawing.o)(.text+0x2728): In function `keyboard_drawing_init': /home/mdrago/rpmbuild/BUILD/gnome-applets/libkbdraw/keyboard-drawing.c:1594: undefined reference to `pango_xft_get_context' collect2: ld returned 1 exit status make[3]: *** [gnome-keyboard-applet] Error 1 make[3]: Leaving directory `/home/mdrago/rpmbuild/BUILD/gnome-applets/gswitchit'make[2]: *** [all-recursive] Error 1 make[2]: Leaving directory `/home/mdrago/rpmbuild/BUILD/gnome-applets/gswitchit'make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/home/mdrago/rpmbuild/BUILD/gnome-applets' make: *** [all] Error 2 I see that keyboard-drawing.c calls pango_xft_set_default_substitute, pango_xft_substitute_changed, and pango_xft_get_context. I see that libpangoxft-1.0.so provides all three of these symbols. I also see that the '-lpangoxft' bit is missing from the command I included above. However, my autofoo knowledge failed me and I was not able to figure out what had to be done to fix it.
That's very strange. In may case, /usr/lib/gdk-2.0.pc requires pangoxft. Also, /usr/lib/pangoxft.pc has Libs: -L${libdir} -lpangoxft-1.0. Is it same in your case?
Nope. Here is the gdk-2.0.pc file that jhbuild built for me just yesterday: prefix=/opt/gnome2 exec_prefix=${prefix} libdir=${exec_prefix}/lib includedir=${prefix}/include target=x11 Name: GDK Description: GIMP Drawing Kit (${target} target) Version: 2.7.6 Requires: gdk-pixbuf-2.0 pango pangocairo Libs: -L${libdir} -lgdk-${target}-2.0 Cflags: -I${includedir}/gtk-2.0 -I${libdir}/gtk-2.0/include I tried adding a 'pangoxft' requirement to the gdk-2.0.pc file and the build still failed. I then took a look at my gdk-x11-2.0.pc file and that looked very similar to the gdk-2.0.pc file. Here is the contents of the gdk-x11-2.0.pc file: prefix=/opt/gnome2 exec_prefix=${prefix} libdir=${exec_prefix}/lib includedir=${prefix}/include target=x11 Name: GDK Description: GIMP Drawing Kit (${target} target) Version: 2.7.6 Requires: gdk-pixbuf-2.0 pango pangocairo Libs: -L${libdir} -lgdk-${target}-2.0 Cflags: -I${includedir}/gtk-2.0 -I${libdir}/gtk-2.0/include Adding a 'pangoxft' requirement to this file however _did_ solve the problem. So, should this bug be reassigned to gtk? I would think that since libkbdraw is making calls to pangoxft itself that it should depend on pangoxft directly and not lean on gdk.
Well, I'd reassign it to gtk. Probably some of them would give comments on this - whether we should put pangoxft explicitly in configure. in - or is it really bug in gtk. Letting them know would not hurt anyway.
well, I added pangoxft to g-c-c and g-a explicitly, in CVS
*** Bug 313491 has been marked as a duplicate of this bug. ***
Created attachment 51180 [details] [review] Patch to add missing AC_SUBST lines to configure.in
Attached patch is still needed, until GTK does fix it itself
pangoxft was used internally in GTK+-2.6, but is no longer used. If apps want to use its facilities, they have to pull it in themselves. (And pay the performance penalty of not sharing fonts with GTK+) What libkbdraw is doing is awful and really needs to be replaced with the facilities availalbe in GTK+-2.6 or newer; see the rotated_text example in gtk-demo. (Or you could rewrite to Cairo, which would be even cleaner, but a bigger change.)
Owen, the problem with pangoxft in kbdraw is real. It is not only matter of linking - it simply does not work (while it was working with gtk 2.6). Could you advise something less than rewriting it from pangoxft to just pango (or, from the scratch, to cairo)? Unfortunately the code is not mine, it was Noah who created it - I am trying to support it but I don't know much about pango as such.
I odn't have time to rewrite it for you. If you read the gtk-demo I pointed to, it shows how to do rotated text much more simply than the way Noah hacked up for GTK+-2.4.
Sure you don't have time, I did not ask you. I just hoped you could give me a hint regarding what was broken in pangoxft (or gtk) lately so g-k-p does not work anymore. Ok, thanks, I'll have a look at the demo.
The change was simply that libkbdraw was just assuming blindly that rendering an Xft layout through GDK would work, and GDK now deals with Cairo layouts not Xft layouts. You could conceivably drop down to Pango Xft directly for drawing, but just using the standard API for rotating text will be vastly cleaner and simpler.
Fixed in CVS. Pangoxft is not used any more.