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 556689 - examples fail to link
examples fail to link
Status: RESOLVED FIXED
Product: libepc
Classification: Other
Component: general
0.3.x
Other Linux
: Normal normal
: ---
Assigned To: libepc maintainers
Depends on:
Blocks:
 
 
Reported: 2008-10-17 09:41 UTC by Götz Waschk
Modified: 2008-10-19 11:46 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
fix linking (5.19 KB, patch)
2008-10-17 10:26 UTC, Götz Waschk
none Details | Review
libepc_examples_build.patch (6.41 KB, patch)
2008-10-19 11:07 UTC, Murray Cumming
none Details | Review

Description Götz Waschk 2008-10-17 09:41:02 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'
Comment 1 Murray Cumming 2008-10-17 10:02:25 UTC
Weird. This version added a check for gthread in configure.ac. Could you try to produce a patch to fix this, please?

Comment 2 Götz Waschk 2008-10-17 10:11:16 UTC
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.
Comment 3 Götz Waschk 2008-10-17 10:26:26 UTC
Created attachment 120775 [details] [review]
fix linking
Comment 4 Murray Cumming 2008-10-19 11:07:39 UTC
Created attachment 120860 [details] [review]
libepc_examples_build.patch

Does this one fix it too? It seems simpler to me.
Comment 5 Götz Waschk 2008-10-19 11:12:43 UTC
Your patch is fine too.
Comment 6 Murray Cumming 2008-10-19 11:46:20 UTC
Thanks. I have committed that and I have released a new tarball.