I have the following two files in VS2008:
Test.cpp
---------------------
#define BOOST_TEST_MODULE MyTest
#include <boost/test/unit_test.hpp>
BOOST_AUTO_TEST_CASE(MyTestCase1)
{
BOOST_REQUIRE(1 == 1);
}
Test2.cpp
---------------------
#define BOOST_TEST_MODULE MyTest2
#include <boost/test/unit_test.hpp>
BOOST_AUTO_TEST_CASE(MyTestCase2)
{
BOOST_CHECK(2 == 2);
}
When I compile, I get the following linker error:
error LNK2005: "class boost::unit_test::test_suite * __cdecl init_unit_test_suite(int,char * * const)" (?init_unit_test_suite@@YAPAVtest_suite@unit_test@boost@@HQAPAD@Z) already defined in Test.obj
I've tried everything, and have no idea why this is happening. I'm using the latest version of the boost.test library available from the BoostPro Computing installer: libboost_unit_test_framework-vc90-mt-gd-1_36.lib, along with the included headers.
Thank you for your help.