Why is this (copied from the promotion site ) giving me an error ?! in VS 2010 Ultimate:
#include <boost\test\unit_test.hpp>
#define BOOST_TEST_MODULE MyTest
int add( int i, int j ) { return i+j; }
BOOST_AUTO_TEST_CASE( my_test )
{
BOOST_CHECK( add( 2,2 ) == 4 );
BOOST_REQUIRE( add( 2,2 ) == 4 );
if( add( 2,2 ) != 4 )
BOOST_ERROR( "Ouch..." );
if( add( 2,2 ) != 4 )
BOOST_FAIL( "Ouch..." );
if( add( 2,2 ) != 4 ) throw "Ouch...";
BOOST_CHECK_MESSAGE( add( 2,2 ) == 4,
"add(..) result: " << add( 2,2 ) );
BOOST_CHECK_EQUAL( add( 2,2 ), 4 );
}
Error
Error 1 error LNK2019: unresolved external symbol "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) referenced in function _main
source
share