GNOME Bugzilla – Bug 140950
compile fails on gcc-3.4.0 for dasher 3.2.10
Last modified: 2005-08-05 16:34:21 UTC
When compiling dasher 3.2.10 on gcc-3.3.3 works fine. On gcc-3.4.0 the compile fails with the following errors Making all in Common g++ -O2 -I/usr/test/garnome3/include/gtk-2.0 -I/usr/test/garnome3/lib/gtk-2.0/include -I/usr/test/garnome3/include/atk-1.0 -I/usr/test/garnome3/include/pango-1.0 -I/usr/local/include -I/usr/local/include/freetype2 -I/usr/X11R6/include -I/usr/test/garnome3/include/glib-2.0 -I/usr/test/garnome3/lib/glib-2.0/include -DORBIT2=1 -I/usr/test/garnome3/include/gconf/2 -I/usr/test/garnome3/include/orbit-2.0 -I/usr/test/garnome3/include/glib-2.0 -I/usr/test/garnome3/lib/glib-2.0/include -I/usr/test/garnome3/include/libglade-2.0 -I/usr/test/garnome3/include/gtk-2.0 -I/usr/test/garnome3/include/libxml2 -I/usr/test/garnome3/lib/gtk-2.0/include -I/usr/test/garnome3/include/atk-1.0 -I/usr/test/garnome3/include/pango-1.0 -I/usr/local/include -I/usr/local/include/freetype2 -I/usr/X11R6/include -I/usr/test/garnome3/include/glib-2.0 -I/usr/test/garnome3/lib/glib-2.0/include -I/usr/test/garnome3/include/glib-2.0 -I/usr/test/garnome3/lib/glib-2.0/include -I./Gtk2/ -I./DasherCore/ -I./../intl -I../intl -DPACKAGE_LOCALE_DIR=\"/share/locale\" -DPROGDATA=\"/usr/test/garnome3/share/dasher\" -g -I/usr/test/garnome3/include -I/usr/X11R6/include -O2 -pipe -falign-functions=4 -mfancy-math-387 -march=athlon-tbird -o dasher main.o -Wl,--export-dynamic -Wl,--export-dynamic -Wl,--export-dynamic -L/usr/test/garnome3/lib -L/usr/X11R6/lib -lgconf-2 -lORBit-2 -lpopt -lglade-2.0 -lgtk-x11-2.0 -lxml2 -lz -lgdk-x11-2.0 -latk-1.0 -lgdk_pixbuf-2.0 -lm -lpangoxft-1.0 -lpangox-1.0 -lpango-1.0 -lgobject-2.0 -lgmodule-2.0 -ldl -pthread -lgthread-2.0 -lpthread -lglib-2.0 -lX11 Gtk2/libdashergtk.a DasherCore/libdashercore.a -lexpat -Wl,--rpath -Wl,/usr/test/garnome3/lib -Wl,--rpath -Wl,/usr/local/lib -Wl,--rpath -Wl,/usr/test/garnome3/lib -Wl,--rpath -Wl,/usr/local/lib Gtk2/libdashergtk.a(edit.o)(.text+0xed6): In function `edit_delete_callback(int)': /usr/download/projects/garnome--kenny--2.5.2--patch-36/garnome/desktop/dasher/work/main.d/dasher-3.2.10/Src/Gtk2/edit.cc:379: undefined reference to `XTestFakeKeyEvent' Gtk2/libdashergtk.a(edit.o)(.text+0xef8):/usr/download/projects/garnome--kenny--2.5.2--patch-36/garnome/desktop/dasher/work/main.d/dasher-3.2.10/Src/Gtk2/edit.cc:380: undefined reference to `XTestFakeKeyEvent' Gtk2/libdashergtk.a(edit.o)(.text+0x1419): In function `edit_output_callback(int)': /usr/download/projects/garnome--kenny--2.5.2--patch-36/garnome/desktop/dasher/work/main.d/dasher-3.2.10/Src/Gtk2/edit.cc:114: undefined reference to `XTestFakeKeyEvent' Gtk2/libdashergtk.a(edit.o)(.text+0x144b):/usr/download/projects/garnome--kenny--2.5.2--patch-36/garnome/desktop/dasher/work/main.d/dasher-3.2.10/Src/Gtk2/edit.cc:116: undefined reference to `XTestFakeKeyEvent' Gtk2/libdashergtk.a(edit.o)(.text+0x1493):/usr/download/projects/garnome--kenny--2.5.2--patch-36/garnome/desktop/dasher/work/main.d/dasher-3.2.10/Src/Gtk2/edit.cc:136: undefined reference to `XTestFakeKeyEvent' Gtk2/libdashergtk.a(edit.o)(.text+0x14c5):/usr/download/projects/garnome--kenny--2.5.2--patch-36/garnome/desktop/dasher/work/main.d/dasher-3.2.10/Src/Gtk2/edit.cc:138: more undefined references to `XTestFakeKeyEvent' follow collect2: ld returned 1 exit status make[4]: *** [dasher] Error 1 make[3]: *** [all-recursive] Error 1 make[2]: *** [all-recursive] Error 1 make[1]: *** [build-work/main.d/dasher-3.2.10/Makefile] Error 2 make: *** [paranoid-install] Error 2 I'm running slackware 8.0 with glibc 2.3.2,gcc-3.4.0,kernel-2.6.6-rc2 I'm compiling the garnome arch tree for gnome 2.6.0
I'm not able to reproduce this, I'm afraid - building with gcc 3.4 works fine here.
I am getting the same error on 3.2.11 Gtk2/libdashergtk.a(edit.o)(.text+0x32f): In function `edit_output_callback(int)': /home/jgbiggs/garnome-2.7.92/desktop/dasher/work/main.d/dasher-3.2.11/Src/Gtk2/edit.cc:138: undefined reference to `XTestFakeKeyEvent' Gtk2/libdashergtk.a(edit.o)(.text+0x348):/home/jgbiggs/garnome-2.7.92/desktop/dasher/work/main.d/dasher-3.2.11/Src/Gtk2/edit.cc:140: undefined reference to `XTestFakeKeyEvent' Gtk2/libdashergtk.a(edit.o)(.text+0x387):/home/jgbiggs/garnome-2.7.92/desktop/dasher/work/main.d/dasher-3.2.11/Src/Gtk2/edit.cc:116: undefined reference to `XTestFakeKeyEvent' Gtk2/libdashergtk.a(edit.o)(.text+0x3a0):/home/jgbiggs/garnome-2.7.92/desktop/dasher/work/main.d/dasher-3.2.11/Src/Gtk2/edit.cc:118: undefined reference to `XTestFakeKeyEvent' Gtk2/libdashergtk.a(edit.o)(.text+0x96b): In function `edit_delete_callback(int)': /home/jgbiggs/garnome-2.7.92/desktop/dasher/work/main.d/dasher-3.2.11/Src/Gtk2/edit.cc:381: undefined reference to `XTestFakeKeyEvent' Gtk2/libdashergtk.a(edit.o)(.text+0x976):/home/jgbiggs/garnome-2.7.92/desktop/dasher/work/main.d/dasher-3.2.11/Src/Gtk2/edit.cc:382: more undefined references to `XTestFakeKeyEvent' follow collect2: ld returned 1 exit status make[4]: *** [dasher] Error 1 make[4]: Leaving directory `/home/jgbiggs/garnome-2.7.92/desktop/dasher/work/main.d/dasher-3.2.11/Src' make[3]: *** [all-recursive] Error 1 make[3]: Leaving directory `/home/jgbiggs/garnome-2.7.92/desktop/dasher/work/main.d/dasher-3.2.11/Src' make[2]: *** [all-recursive] Error 1 make[2]: Leaving directory `/home/jgbiggs/garnome-2.7.92/desktop/dasher/work/main.d/dasher-3.2.11' make[1]: *** [build-work/main.d/dasher-3.2.11/Makefile] Error 2 make[1]: Leaving directory `/home/jgbiggs/garnome-2.7.92/desktop/dasher' make: *** [paranoid-install] Error 2 FC2 system.
I get this error as well on a Slackware 10.0 system when compiling dasher-3.2.11. It looks to me like the configure script checks for the existence of XTestFakeKeyEvent in the XTest library before checking if -lXtst in /usr/X11R6/lib: from config.log: configure:11130: checking for XTestFakeKeyEvent in -lXtst configure:11160: gcc -o conftest -g -O2 conftest.c -lXtst -lexpat >&5 /usr/lib/gcc-lib/i486-slackware-linux/3.3.4/../../../../i486-slackware-linux/bin/ld: cannot find -lXtst collect2: ld returned 1 exit status configure:11166: $? = 1 configure: failed program was: | /* confdefs.h. */ | | #define PACKAGE_NAME "dasher" | #define PACKAGE_TARNAME "dasher" | #define PACKAGE_VERSION "3.2.11" | #define PACKAGE_STRING "dasher 3.2.11" | #define PACKAGE_BUGREPORT "dasher@mrao.cam.ac.uk" | #define PACKAGE "dasher" | #define VERSION "3.2.11" | #define STDC_HEADERS 1 | #define HAVE_SYS_TYPES_H 1 | #define HAVE_SYS_STAT_H 1 | #define HAVE_STDLIB_H 1 | #define HAVE_STRING_H 1 | #define HAVE_MEMORY_H 1 | #define HAVE_STRINGS_H 1 | #define HAVE_INTTYPES_H 1 | #define HAVE_STDINT_H 1 | #define HAVE_UNISTD_H 1 | #define HAVE_DLFCN_H 1 | #define HAVE_ICONV 1 | #define ICONV_CONST | #define GETTEXT_PACKAGE "dasher" | #define HAVE_LOCALE_H 1 | #define HAVE_LC_MESSAGES 1 | #define HAVE_BIND_TEXTDOMAIN_CODESET 1 | #define HAVE_GETTEXT 1 | #define HAVE_DCGETTEXT 1 | #define ENABLE_NLS 1 | #ifdef __cplusplus | extern "C" void std::exit (int) throw (); using std::exit; | #endif | #define HAVE_LIBEXPAT 1 | /* end confdefs.h. */ | | /* Override any gcc2 internal prototype to avoid an error. */ | #ifdef __cplusplus | extern "C" | #endif | /* We use char because int might match the return type of a gcc2 | builtin and then its argument prototype would still apply. */ | char XTestFakeKeyEvent (); | int | main () | { | XTestFakeKeyEvent (); | ; | return 0; | } configure:11191: result: no configure:11204: checking for -lXtst in /usr/X11R6/lib configure:11222: gcc -o conftest -g -O2 conftest.c -L/usr/X11R6/lib -lXtst >&5 configure:11228: $? = 0 This causes -lXtst to not be included in the LDFLAGS, which causes the error when linking. Unfortunately, I lack the knowledge of autoconf to fix this. Additionally, if I set the LDFLAG environment variable to "-L/usr/X11R6/lib -lXtst" before running configure, then everything works just peachy. from config.log with LDFLAGS set: configure:11130: checking for XTestFakeKeyEvent in -lXtst configure:11160: gcc -o conftest -g -O2 -L/usr/X11R6/lib -lXtst conftest.c -lXtst -lexpat >&5 configure:11166: $? = 0 configure:11169: test -z || test ! -s conftest.err configure:11172: $? = 0 configure:11175: test -s conftest configure:11178: $? = 0 Compilation finishes successfully in this case.
Well, after poking around a little more, it seems my earlier statements were incorrect. I had mistakenly compared a clean extraction and build directory with one created by the GARNOME script. The only solution I could come up with in the GARNOME situation was to define the X_LIB variable in a environment variable, which finally allowed GARNOME to compile dasher.
It looks like this problem: http://bugs.gentoo.org/show_bug.cgi?id=79181 Maybe the patch from comment #1 there can help you.
I just read the bug report and saw that the patch was commited. I'm still having issues with version 3.2.13. I'll have a better look tomorrow to see if the issue is still the same. Thanks for the heads up
Stef, maybe I'm misunderstanding you, but notice that the commit was for Gentoo's package. I added that comment to let the upstream developers know about the issue so they could see if something like that patch should be committed to dasher's tree.
The current dasher version is compiling fine using gcc-4.0.1
I think this bug has a misleading title, the problem is not with gcc versions, but in the configure script, where the test used to detect the Xtst library is incorrect. The lines where X_LIBS and HAVE_XTST are set are inside an "if test "x$XTST_LIBS" = x;" block, so they don't get to run if the previous AC_CHECK_LIB() macro succeeds in the first place. The patch mentioned in comment #5 goes something like this: #---cut--- diff -ur dasher-3.2.11.orig/configure.in dasher-3.2.11/configure.in --- dasher-3.2.11.orig/configure.in 2004-07-12 16:25:09.000000000 +0200 +++ dasher-3.2.11/configure.in 2005-01-23 09:53:02.000000000 +0100 @@ -89,12 +89,12 @@ LIBS="$save_LIBS" break],[AC_MSG_RESULT(no)]) done - if test "x$XTST_LIBS" = x; then - AC_MSG_ERROR(Couldn't find the Xtst library. Check config.log for details) - else - X_LIBS="$X_LIBS $XTST_LIBS" - AC_DEFINE(HAVE_XTST, 1, [The XTest extension is present]) - fi + fi + if test "x$XTST_LIBS" = x; then + AC_MSG_ERROR(Couldn't find the Xtst library. Check config.log for details) + else + X_LIBS="$X_LIBS $XTST_LIBS" + AC_DEFINE(HAVE_XTST, 1, [The XTest extension is present]) fi AC_SUBST(X_LIBS) #---cut---
I applied this to gnome-2-12 branch.