GNOME Bugzilla – Bug 556689
examples fail to link
Last modified: 2008-10-19 11:46:20 UTC
This is on Mandriva Cooker with libepc 0.3.6. The default linker flags contain --no-undefined and --as-needed: /bin/sh ./libtool --tag=CC --mode=link gcc -Wall -DG_DISABLE_DEPRECATED=1 -DGDK_DISABLE_DEPRECATED=1 -DGTK_DISABLE_DEPRECATED=1 -DLOCALEDIR=\"/usr/share/locale\" -D_REENTRANT -pthread -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/uuid -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/libsoup-2.4 -I/usr/include/libxml2 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -O2 -g -pipe -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -fomit-frame-pointer -march=i586 -mtune=generic -fasynchronous-unwind-tables -Wl,--as-needed -Wl,--no-undefined -o examples/simple-publisher examples/examples_simple_publisher-simple-publisher.o libepc/libepc-1.0.la gcc -Wall -DG_DISABLE_DEPRECATED=1 -DGDK_DISABLE_DEPRECATED=1 -DGTK_DISABLE_DEPRECATED=1 -DLOCALEDIR=\"/usr/share/locale\" -D_REENTRANT -pthread -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/uuid -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/libsoup-2.4 -I/usr/include/libxml2 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -O2 -g -pipe -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -fomit-frame-pointer -march=i586 -mtune=generic -fasynchronous-unwind-tables -Wl,--as-needed -Wl,--no-undefined -o examples/.libs/simple-publisher examples/examples_simple_publisher-simple-publisher.o libepc/.libs/libepc-1.0.so examples/examples_simple_publisher-simple-publisher.o: In function `main': /home/goetz/svn/libepc/BUILD/libepc-0.3.6/examples/simple-publisher.c:109: undefined reference to `g_thread_init'
Weird. This version added a check for gthread in configure.ac. Could you try to produce a patch to fix this, please?
Sure. My current workaround is to call make LIBS=-lgthread-2.0. gthread was not added to the examples linker flags, only to the flags of libepc.la.
Created attachment 120775 [details] [review] fix linking
Created attachment 120860 [details] [review] libepc_examples_build.patch Does this one fix it too? It seems simpler to me.
Your patch is fine too.
Thanks. I have committed that and I have released a new tarball.