[test] linking problems with boost-1.32.0-5.fc3.i386.rpm

Hi, I upgraded today to boost-1.32.0-5.fc3.i386.rpm and my projects stoped linking complaining about libboost_unit_test_framework.so: undefined reference to `init_unit_test_suite(int, char**)'. I'm not a linker expert but it seems like libboost_unit_test_framework library does not have a weak symbol init_unit_test_suite anymore. I had to rollback to boost-1.32.0-3.i386.rpm. I'd like to know is that my problem or ...? Here are the details: [max@my text-rpc]$ rpm -qa | grep boost boost-1.32.0-5.fc3 boost-devel-1.32.0-5.fc3 [max@my text-rpc]$ scons -c scons: Reading SConscript files ... scons: done reading SConscript files. scons: Cleaning targets ... ... scons: done cleaning targets. [max@my text-rpc]$ scons scons: Reading SConscript files ... scons: done reading SConscript files. scons: Building targets ... ... g++ -o bin/maind obj/debug/text_rpc.o obj/debug/bison_parser.o obj/debug/parser_callback.o obj/debug/pdu.yy.o obj/debug/pdu.ll.o obj/debug/main.o -lboost_unit_test_framework /usr/lib/gcc/i386-redhat-linux/3.4.2/../../../libboost_unit_test_framework.so: undefined reference to `init_unit_test_suite(int, char**)' Collect2: ld returned 1 exit status scons: *** [bin/maind] Error 1 scons: building terminated because of errors. [max@my text-rpc]$ sudo rpm -e $(rpm -qa | grep boost) [max@my text-rpc]$ rpm -qa | grep boost [max@my text-rpc]$ ls ~/downloads/boost-* /home/max/downloads/boost-1.32.0-3.i386.rpm /home/max/downloads/boost-devel-1.32.0-3.i386.rpm [max@my text-rpc]$ sudo rpm -Uvh ~/downloads/boost* warning: /home/max/downloads/boost-1.32.0-3.i386.rpm: V3 DSA signature: NOKEY, key ID 30c9ecf8 Preparing... ########################################### [100%] 1:boost ########################################### [ 50%] 2:boost-devel ########################################### [100%] [max@my text-rpc]$ rpm -qa | grep boost boost-1.32.0-3 boost-devel-1.32.0-3 [max@my text-rpc]$ scons scons: Reading SConscript files ... scons: done reading SConscript files. scons: Building targets ... g++ -o bin/maind obj/debug/text_rpc.o obj/debug/bison_parser.o obj/debug/parser_callback.o obj/debug/pdu.yy.o obj/debug/pdu.ll.o obj/debug/main.o -lboost_unit_test_framework g++ -fmessage-length=0 -Wall -Wextra -ggdb -Iinclude -c -o obj/debug/unit_test.o src/unit_test.cpp g++ -o bin/unit_testd obj/debug/text_rpc.o obj/debug/bison_parser.o obj/debug/parser_callback.o obj/debug/pdu.yy.o obj/debug/pdu.ll.o obj/debug/unit_test.o -lboost_unit_test_framework ar r lib/libtext_rpcd.a obj/debug/text_rpc.o obj/debug/bison_parser.o obj/debug/parser_callback.o obj/debug/pdu.yy.o obj/debug/pdu.ll.o ranlib lib/libtext_rpcd.a ar: creating lib/libtext_rpcd.a scons: done building targets. -- Maxim Yegorushkin

Maxim Yegorushkin wrote:
Hi,
I upgraded today to boost-1.32.0-5.fc3.i386.rpm and my projects stoped linking complaining about libboost_unit_test_framework.so: undefined reference to `init_unit_test_suite(int, char**)'.
I think the standard approach when using packages is to report the bug to the package maintainer. In particular, nobody but him know what version/CVS date that package corresponds too.
I'm not a linker expert but it seems like libboost_unit_test_framework library does not have a weak symbol init_unit_test_suite anymore. I had to rollback to boost-1.32.0-3.i386.rpm.
Why should unit_test_framework define such a symbol? Especially 'weak'? If you link to libboost_unit_test_framework you are supposed to provide init_unit_test_suite function in your application, no? Do you provide one? For details, here's output from 'readelf -W -a <unit_test_lib.so>' where the lib is produced with Boost.Build V2: 917: 00000000 0 NOTYPE GLOBAL DEFAULT UND _Z20init_unit_test_suiteiPPc The symbol is underfined, not weak. And I get no link error for test/example/unit_test_example1. - Volodya

On Thu, 24 Mar 2005 15:38:09 +0300, Vladimir Prus <ghost@cs.msu.su> wrote:
Maxim Yegorushkin wrote:
Hi,
I upgraded today to boost-1.32.0-5.fc3.i386.rpm and my projects stoped linking complaining about libboost_unit_test_framework.so: undefined reference to `init_unit_test_suite(int, char**)'.
I think the standard approach when using packages is to report the bug to the package maintainer. In particular, nobody but him know what version/CVS date that package corresponds too.
Understood.
I'm not a linker expert but it seems like libboost_unit_test_framework library does not have a weak symbol init_unit_test_suite anymore. I had to rollback to boost-1.32.0-3.i386.rpm.
Why should unit_test_framework define such a symbol? Especially 'weak'? If you link to libboost_unit_test_framework you are supposed to provide init_unit_test_suite function in your application, no? Do you provide one?
For details, here's output from 'readelf -W -a <unit_test_lib.so>' where the lib is produced with Boost.Build V2:
917: 00000000 0 NOTYPE GLOBAL DEFAULT UND _Z20init_unit_test_suiteiPPc
The symbol is underfined, not weak. And I get no link error for test/example/unit_test_example1.
I'm now pretty much sure I diagnosed the problem wrong (regarding the weak symbol). Thanks for the elaboration. -- Maxim Yegorushkin
participants (2)
-
Maxim Yegorushkin
-
Vladimir Prus