GNOME Bugzilla – Bug 583618
must link directly to libXext on Solaris
Last modified: 2010-05-07 15:15:12 UTC
On Solaris, you have to explicitly link to libraries whose symbols you use. Simply linking against gtk which then links to libXext works on Linux, but not Solaris. The solution is to add PKG_CHECK_MODULES(XEXT, xext) and substituting the appropriate variables. Undefined first referenced symbol in file XSyncDestroyAlarm gs-idle-monitor.o (symbol belongs to implicit dependency /usr/X11/lib/libXext.so.0) XSyncFreeSystemCounterList gs-idle-monitor.o (symbol belongs to implicit dependency /usr/X11/lib/libXext.so.0) XSyncChangeAlarm gs-idle-monitor.o (symbol belongs to implicit dependency /usr/X11/lib/libXext.so.0) XSyncInitialize gs-idle-monitor.o (symbol belongs to implicit dependency /usr/X11/lib/libXext.so.0) XSyncQueryExtension gs-idle-monitor.o (symbol belongs to implicit dependency /usr/X11/lib/libXext.so.0) XSyncListSystemCounters gs-idle-monitor.o (symbol belongs to implicit dependency /usr/X11/lib/libXext.so.0) XSyncCreateAlarm gs-idle-monitor.o (symbol belongs to implicit dependency /usr/X11/lib/libXext.so.0)
OS X has same build failure.
It's only by luck that compiling even gets this far I think. ./configure already tests for X11/extensions/sync.h: >have_xsync=no >AC_CHECK_HEADER(X11/extensions/sync.h, [have_xsync=yes],, > [#include <X11/Xlib.h>]) >if test "$have_xsync" = yes; then > AC_DEFINE(HAVE_XSYNC, 1, [Have the SYNC extension library]) >fi but the gs-idle-monitor.c #inlude of sync.h and the use of its features is not conditioned on HAVE_XSYNC, so probably megafail if it doesn't exist. Secondarily, that AC_CHECK_HEADER and AC_DEFINE is reinventing a wheel: AC_CHECK_HEADERS does it all for you with a clearer, self-documented AC_DEFINE token.
commit b7926c7bada91a333e2c49da83808589191b8a8f Author: Colin Walters <walters@verbum.org> Date: Fri May 7 11:10:42 2010 -0400 Explicitly add -lXext -lXau to linker line Newer versions of GCC require all libraries to be explicitly specified. https://bugzilla.gnome.org/show_bug.cgi?id=583618