[test] build problem/regression with RC_1_34_0
Hi, With last weekend's cvs version of RC_1_34_0 is was able to use the dynamic-library version of the unit_test_framework. Since I did a cvs update yesterday I get a link error trying to do so: g++ -o build/debug/test/kern/test_macros.o -c -g -Wall -ftemplate-depth-255 -O0 -fno-inline -DBOOST_TEST_DYN_LINK -I. -I/home/hoeppler/src/boost_RC_1_34_0 test/kern/test_macros.cpp g++ -o build/debug/test/kern/test_macros -Wl,-rpath-link,. build/debug/test/kern/test_macros.o build/debug/src/kern/parser/macros.o -L/home/hoeppler/src/boost_RC_1_34_0/stage/lib -lboost_filesystem-gcc41-d -lboost_regex-gcc41-d -lboost_unit_test_framework-gcc41-d /usr/lib/gcc/i586-suse-linux/4.1.0/../../../crt1.o: In function `_start': init.c:(.text+0x18): undefined reference to `main' collect2: ld returned 1 exit status Addidtional information: This is gcc-4.1.0 on linux. The boost libs were built with the boost build system. I am setting up test_suits as follows: test_suite* init_unit_test_suite( int, char* [] ) { test_suite* test(BOOST_TEST_SUITE("Unit test macros")); // <snip> return test; } Any idea what's going wrong? Thanks Chris
"Chris Hoeppler"
/usr/lib/gcc/i586-suse-linux/4.1.0/../../../crt1.o: In function `_start': init.c:(.text+0x18): undefined reference to `main' collect2: ld returned 1 exit status
Addidtional information: This is gcc-4.1.0 on linux. The boost libs were built with the boost build system. I am setting up test_suits as follows:
test_suite* init_unit_test_suite( int, char* [] ) { test_suite* test(BOOST_TEST_SUITE("Unit test macros"));
// <snip>
return test; }
Any idea what's going wrong?
I am not sure how did it work before, but above code couldn't be used with DLL design that comes with 1.34. My guess is you somehow were using old dynamic library that only worked on non-NT platforms, but included main. With latest Volodia's changes you are now forced to comply to the proper interfaces in latest design. Gennadiy
Gennadiy Rozental wrote:
"Chris Hoeppler"
wrote in message news:200611160706.29326.hoeppler@gmx.net... /usr/lib/gcc/i586-suse-linux/4.1.0/../../../crt1.o: In function `_start': init.c:(.text+0x18): undefined reference to `main' collect2: ld returned 1 exit status
Addidtional information: This is gcc-4.1.0 on linux. The boost libs were built with the boost build system. I am setting up test_suits as follows:
test_suite* init_unit_test_suite( int, char* [] ) { test_suite* test(BOOST_TEST_SUITE("Unit test macros"));
// <snip>
return test; }
Any idea what's going wrong?
I am not sure how did it work before,
It worked before because V2 was building DLL without setting BOOST_TEST_DYN_LINK, so Boost.Test was defining the main function, and it worked.
but above code couldn't be used with DLL design that comes with 1.34. My guess is you somehow were using old dynamic library that only worked on non-NT platforms, but included main. With latest Volodia's changes you are now forced to comply to the proper interfaces in latest design.
And the primary reason for Jamfile change was that they worked differently from V1 Jamfiles. I have no opinion whether additional inconvenience on Linux outweight advantages of portability to Windows -- that's Gennadiy's design decision. - Volodya
/usr/lib/gcc/i586-suse-linux/4.1.0/../../../crt1.o: In function `_start': init.c:(.text+0x18): undefined reference to `main' collect2: ld returned 1 exit status
Addidtional information: This is gcc-4.1.0 on linux. The boost libs were built with the boost build system. I am setting up test_suits as follows:
test_suite* init_unit_test_suite( int, char* [] ) { test_suite* test(BOOST_TEST_SUITE("Unit test macros"));
// <snip>
return test; }
Any idea what's going wrong?
I am not sure how did it work before,
It worked before because V2 was building DLL without setting BOOST_TEST_DYN_LINK, so Boost.Test was defining the main function, and it worked.
Okay, I see.
but above code couldn't be used with DLL design that comes with 1.34. My guess is you somehow were using old dynamic library that only worked on non-NT platforms, but included main. With latest Volodia's changes you are now forced to comply to the proper interfaces in latest design.
I was following the instructions in the RC_1_34_0 documentation of the library (see boost_RC_1_34_0/libs/test/doc/components/utf/compilation.html#static_build). I thought compiling with BOOST_TEST_DYN_LINK defined, as stated there, should suffice to allow linking with the dynamic library. Seems like I missed something in the docs? Okay, I looked at the utf-tests and from what I observed there, it seems that (at least with gcc on linux) one has to use the static library version now if "init_unit_test_suite" is used to set up tests. Is that correct? Thanks, Chris
participants (3)
-
Chris Hoeppler
-
Gennadiy Rozental
-
Vladimir Prus