Problem linking Boost Unit Test Library on windows (1.33.0)

Hi! I have a problem linking our application on windows. Somebody added test cases using the boost unit test library, and since then windows won't link anymore. The problem is, that the boost library contains a "main" and doesn't seem to contain a "init_unit_test_suite" function (am I missing a library?). It works on all other systems, is windows unsupported there? Is there any more information I should gather for you to see the problem, or is this a known issue (I remember seeing something on the list about this, but I think it was about a newer boost version. Can any eventually made changes be expressed as a patch for 1.33.0 so I can locally fix the issue, and won't need an upgrade)? Cheers, Markus

Hello Markus, you should not link your _application_ against boost test at all. IMHO, you should compile the test cases in a separate executable that runs all tests one after the other. The simplest way to avoid any link hassle there is to have a single cpp file containing #define BOOST_AUTO_TEST_MAIN #include <boost/test/auto_unit_test.hpp> #include <boost/test/included/unit_test_framework.hpp> And compile this (together with your test cases) into a command line executable. That way, the linker has a little bit more to do on each compiler run, but you do avoid any mismatch of compiler options and the like. Yours, -- Dr. Martin Schulz (schulz@synopsys.com) Senior R&D Engineer Synopsys GmbH Karl-Hammerschmidt-Str. 34 D-85609 Dornach, Germany Munich office: +49 (89) 993-20203 Home office: +49 (721) 6099511 http://www.synopsys.com
-----Original Message----- From: boost-bounces@lists.boost.org [mailto:boost-bounces@lists.boost.org] On Behalf Of Duft Markus Sent: Donnerstag, 28. Februar 2008 08:42 To: boost@lists.boost.org Subject: [boost] Problem linking Boost Unit Test Library on windows (1.33.0)
Hi!
I have a problem linking our application on windows. Somebody added test cases using the boost unit test library, and since then windows won't link anymore. The problem is, that the boost library contains a "main" and doesn't seem to contain a "init_unit_test_suite" function (am I missing a library?). It works on all other systems, is windows unsupported there?
Is there any more information I should gather for you to see the problem, or is this a known issue (I remember seeing something on the list about this, but I think it was about a newer boost version. Can any eventually made changes be expressed as a patch for 1.33.0 so I can locally fix the issue, and won't need an upgrade)?
Cheers, Markus _______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

Martin Schulz <Martin.Schulz <at> synopsys.com> writes:
Hello Markus,
you should not link your _application_ against boost test at all.
This is wrong statement. Boost.Test supports *both* link with library and avoid it by using sungle header version of Boost.Test
IMHO, you should compile the test cases in a separate executable that runs all tests one after the other.
The simplest way to avoid any link hassle there is to have a single cpp file containing
#define BOOST_AUTO_TEST_MAIN #include <boost/test/auto_unit_test.hpp> #include <boost/test/included/unit_test_framework.hpp>
If you are using 1.34 the correct lines are #define BOOST_TEST_MAIN #include <boost/test/unit_test.hpp> or #define BOOST_TEST_MODULE master suite name here #include <boost/test/unit_test.hpp> Gennadiy
participants (3)
-
Duft Markus
-
Gennadiy Rozental
-
Martin Schulz