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 559638 - Compile failure: missing link against libX11
Compile failure: missing link against libX11
Status: RESOLVED FIXED
Product: zenity
Classification: Core
Component: general
2.24.x
Other Mac OS
: Normal normal
: ---
Assigned To: Zenity Maintainers
Zenity Maintainers
: 574437 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2008-11-06 18:31 UTC by Daniel Macks
Modified: 2010-07-22 22:56 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
check for X when GDK backend is X11 (995 bytes, patch)
2009-01-07 20:55 UTC, Frederic Peters
committed Details | Review

Description Daniel Macks 2008-11-06 18:31:18 UTC
Building zenity-2.24.0 on OS X 10.4 with gtk+-2.14.4 (built for x11 GUI):

gcc -I/sw/lib/fontconfig2/include -I/sw/include/glib-2.0 -I/sw/lib/glib-2.0/include -I/sw/lib/freetype219/include/freetype2 -I/sw/lib/freetype219/include -I/sw/lib/pango-ft219/include/pango-1.0 -I/sw/include/libpng12 -I/sw/include -I/sw/include/pixman-1 -I/sw/include/cairo -I/sw/include/gtk-2.0 -I/sw/include/atk-1.0 -I/sw/lib/gtk-2.0/include -I/sw/include/libart-2.0 -I/sw/include/gail-1.0 -I/sw/include/libgnomecanvas-2.0 -I/sw/include/libxml2 -I/sw/include/libglade-2.0 -I/usr/X11R6/include -I/usr/X11/include  -Wall -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wno-sign-compare   -Os  -L/sw/lib -o zenity zenity-about.o zenity-calendar.o zenity-entry.o zenity-fileselection.o zenity-main.o zenity-msg.o zenity-notification.o zenity-option.o zenity-progress.o zenity-scale.o zenity-text.o zenity-tree.o zenity-util.o -L/sw/lib/fontconfig2/lib -L/sw/lib -L/sw/lib/freetype219/lib -L/sw/lib/pango-ft219/lib -Wl,-framework,CoreServices -Wl,-framework,ApplicationServices -lglade-2.0 -lxml2 -lgnomecanvas-2 -lart_lgpl_2 -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgio-2.0 -lpangoft2-1.0 -lgdk_pixbuf-2.0 -lpangocairo-1.0 -lcairo -lpango-1.0 -lfreetype -lz -lfontconfig -lgobject-2.0 -lgmodule-2.0 -lglib-2.0 -lintl   
/usr/libexec/gcc/powerpc-apple-darwin8/4.0.1/ld: Undefined symbols:
_XFree
_XGetWMName
_XGetWindowAttributes
_XQueryTree
collect2: ld returned 1 exit status
make[2]: *** [zenity] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2

Yup, zenity is using X11 symbols directly but not linking against libX11. It probably used to work because gtk published -lX11 via pkg-config. But it didn't need to (programs that use gtk don't need to link against libX11 themselves) and recently stopped publishing this flag. So zenity's ./configure needs to determine and use the appropriate X11 flags itself.
Comment 1 Daniel Macks 2008-11-06 19:00:21 UTC
Looks like svn revision 424 from long ago fixed this bug, but then the fix got removed: X_LIBS is still passed in src/Makefile.am but that variable isn't set in configure.in. That fix was only half-way though...also need -I flag (again it only "works" as a side effect of gtk leaking some of its internal details). Is there a functional problem with passing multiple -lX11 flags to the linker? Just check for whether gdk is using the x11 GUI, and if so do some standard configure check for X11 flags...
Comment 2 Frederic Peters 2009-01-07 20:55:50 UTC
Created attachment 125965 [details] [review]
check for X when GDK backend is X11

This check for X (and add appropriate CFLAGS/LIBS) when the GDK backend is X11. (adapted from a check in evolution configure.in).
Comment 3 paul 2009-03-09 19:18:02 UTC
*** Bug 574437 has been marked as a duplicate of this bug. ***
Comment 4 Lucas Rocha 2009-08-08 16:38:08 UTC
Pushed to master, thanks!
Comment 5 Daniel Macks 2010-02-22 06:48:37 UTC
Tweak needed: now that X_{CFLAGS,LIBS} are appended to ZENITY_{CFLAGS,LIBS}, the explicit X_LIBS is redundant in the following src/Makefile.am recipe:

> zenity_LDADD = \
> 	$(ZENITY_LIBS)		\
> 	$(LIBNOTIFY_LIBS)	\
> 	$(X_LIBS)

since ZENITY_LIBS is already there.
Comment 6 Arx Cruz 2010-07-22 22:56:50 UTC
Pushed to master!
Thanks!