Boost logo

Boost Testing :

From: Gennadiy Rozental (rogeeff_at_[hidden])
Date: 2008-07-24 16:24:55


David Hartman <dhartman <at> adfsolutions.com> writes:

> How do I need to configure the build for the test library, using
> gcc 4.3.1, boost 1.35.0, on linux? I want to ustin init_unit_test_suite.
> Getting undefined reference to main error, linking the test program. No
> error linking with a boost 1.33.1 that was built using gcc 4.2.3.

This was discussed in length on the list. Short answer: you've got 3 options

1. You need to ensure you are using static library in your link command line.
2. You can switch to the dynamic library variant of UTF by defining
BOOST_TEST_DYN_LINK and implementing your own main function.
3. You can switch to the dynamic library variant of UTF and employ automated
registration facilties like BOOST_AUTO_TEST_CASE, in which case you don't need
either main or init functions.

Gennadiy


Boost-testing list run by mbergal at meta-comm.com