Undefined reference to 'main' with Boost Test. Why?

Why in the heck did the boost unit test framework change to remove main?
Why does the documentation not reflect this? Why are the example
describing the old behavior? How am I now suppose to use the Boost unit
test framework?
The following program will NOT compile because of the change in 1.34.1
since the 1.33:
/* test_grnn.cpp
#include

Stephen Torri
Why in the heck did the boost unit test framework change to remove main?
Shared lib version of Boost.Test does not include main for portability reasons. You can search for very long discussion on this topic in the mailing list.
Enforce linking with static library in your command line.
Alternatively you can write above test module as: #define BOOST_TEST_DYN_LINK #define BOOST_TEST_MODULE GRNN test suite BOOST_AUTO_TEST_CASE( test_distance_squared ) { .... } and it will work with shared lib. Remove define BOOST_TEST_DYN_LINK and it will work with static lib as well. Gennadiy

On Tue, 2008-03-11 at 19:09 +0000, Gennadiy Rozental wrote:
What I want to know is how I can create a layered test suite like is eluded to by the documentation? The documentation does not provide any examples of a test suite within a test suite. I can change my test program to follow the above format since its is quite simple. Stephen

Stephen Torri
It's covered in docs. You can use BOOST_AUTO_TEST_SUITE. There is an example of coplex hierarhy there as well. In general it's as simple as: BOOST_AUTO_TEST_SUITE(s1) BOOST_AUTO_TEST_CASE(test1) { } BOOST_AUTO_TEST_SUITE(internal_suite) BOOST_AUTO_TEST_CASE(test1) { } BOOST_AUTO_TEST_SUITE_END() BOOST_AUTO_TEST_SUITE_END() BOOST_AUTO_TEST_SUITE(s2) BOOST_AUTO_TEST_CASE(test1) { } BOOST_AUTO_TEST_SUITE_END() Gennadiy

Here is my updated test program. The compiler still complains about the
undefined reference to main.
-----------------------
Compile results
/bin/bash ../../../../libtool --tag=CXX --mode=link g++ -g -O2 -Werror -DNO_LIBREVERSE_DEBUG -static -o test_grnn test_grnn-test_grnn.o \
-L../../../../libreverse -lreverse -lboost_date_time -lboost_unit_test_framework
g++ -g -O2 -Werror -DNO_LIBREVERSE_DEBUG -o test_grnn test_grnn-test_grnn.o -L/home/storri/src/libreverse/libreverse /home/storri/src/libre\
verse/libreverse/.libs/libreverse.a -L/Libs -L/lib -licui18n /usr/lib/libexpat.so -lboost_filesystem -lgcov -lboost_date_time -lboost_unit_t\
est_framework
/usr/lib/gcc/i486-linux-gnu/4.1.3/../../../../lib/crt1.o: In function `_start':
(.text+0x18): undefined reference to `main'
collect2: ld returned 1 exit status
make[1]: *** [test_grnn] Error 1
make[1]: Leaving directory `/home/storri/src/libreverse/libreverse/components/input/grnn'
make: *** [check-am] Error 2
-----------------------
#include
participants (2)
-
Gennadiy Rozental
-
Stephen Torri