[Test] unit_test_framework link problem

Hi, Up to boost version 1.33.1 I used to be able to successfully build my unitests, which define a testsuite with the library function init_unit_test_suite, like this: g++ -o build/debug/test/devs/test_shdevlib.o -c -g -Wall -ftemplate-depth-255 -O0 -fno-inline -I. -I/home/boost/src/boost-built test/devs/test_shdevlib.cpp g++ -o build/debug/test/devs/test_shdevlib -Wl,-rpath-link,. -rdynamic build/debug/test/devs/test_shdevlib.o -L/home/boost/src/boost-built/stage/lib -lboost_unit_test_framework-gcc-d -ldl With the current cvs version of boost this doesn't work any more. Linking fails with the following error: /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../crt1.o(.text+0x18): In function `_start': ../sysdeps/i386/elf/start.S:98: undefined reference to `main' collect2: ld returned 1 exit status This is on linux with gcc 3.3.3. Is this usage of the UTF not supported any more? How do I have to change the way I'm building my unit tests? Linking to the static version? TIA, Chris

"Chris Hoeppler"
Hi,
Up to boost version 1.33.1 I used to be able to successfully build my unitests, which define a testsuite with the library function init_unit_test_suite, like this:
g++ -o build/debug/test/devs/test_shdevlib.o -c -g -Wall -ftemplate-depth-255 -O0 -fno-inline -I. -I/home/boost/src/boost-built test/devs/test_shdevlib.cpp g++ -o build/debug/test/devs/test_shdevlib -Wl,-rpath-link,. -rdynamic build/debug/test/devs/test_shdevlib.o -L/home/boost/src/boost-built/stage/lib -lboost_unit_test_framework-gcc-d -ldl
With the current cvs version of boost this doesn't work any more. Linking fails with the following error:
/usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../crt1.o(.text+0x18): In function `_start': ../sysdeps/i386/elf/start.S:98: undefined reference to `main' collect2: ld returned 1 exit status
This is on linux with gcc 3.3.3.
Is this usage of the UTF not supported any more? How do I have to change the way I'm building my unit tests? Linking to the static version?
Hi, It's slightly unclear from your message, but it looks like you are using dynamic version of the Unit Test Framework. This configuration was not portable and indeed was reworked. My recomentation is wait a bit for updated docs. If you are really desperate - try reading cvs docs - unit test framework compilation page (but nothing else - it's garbage). Gennadiy

On Sunday 26 March 2006 19:05, Gennadiy Rozental wrote:
It's slightly unclear from your message, but it looks like you are using dynamic version of the Unit Test Framework.
That's correct.
This configuration was not portable and indeed was reworked. My recomentation is wait a bit for updated docs. If you are really desperate - try reading cvs docs - unit test framework compilation page (but nothing else - it's garbage).
Okay, I will try that. Thanks Chris
participants (2)
-
Chris Hoeppler
-
Gennadiy Rozental