Boost logo

Boost Testing :

Subject: [Boost-testing] Problem with Simple Tests on Windows
From: BlueRaja (blueraja.admin_at_[hidden])
Date: 2008-11-18 07:50:13


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_at_unit_test_at_boost@@HQAPAD_at_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.



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