Jump to content
  • Advertisement
Sign in to follow this  
rick_appleton

Boost.Test with multiple files

This topic is 3641 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm having problems using Boost.Test if I split up my tests into multiple files. If I define BOOST_TEST_DYN_LINK I get the following errors:
c:\program files\boost\boost_1_36_0\boost\test\impl\compiler_log_formatter.ipp(46) : warning C4273: 'boost::unit_test::output::compiler_log_formatter::log_start' : inconsistent dll linkage
        c:\program files\boost\boost_1_36_0\boost\test\output\compiler_log_formatter.hpp(39) : see previous definition of 'log_start'
c:\program files\boost\boost_1_36_0\boost\test\impl\compiler_log_formatter.ipp(56) : warning C4273: 'boost::unit_test::output::compiler_log_formatter::log_finish' : inconsistent dll linkage
.
.
.
and if I don't define that I get the following
matrix.obj : error LNK2005: "public: virtual void __thiscall boost::unit_test::output::compiler_log_formatter::log_start(class std::basic_ostream<char,struct std::char_traits<char> > &,unsigned long)" (?log_start@compiler_log_formatter@output@unit_test@boost@@UAEXAAV?$basic_ostream@DU?$char_traits@D@std@@@std@@K@Z) already defined in camera.obj
matrix.obj : error LNK2005: "public: virtual void __thiscall boost::unit_test::output::compiler_log_formatter::log_finish(class std::basic_ostream<char,struct std::char_traits<char> > &)" (?log_finish@compiler_log_formatter@output@unit_test@boost@@UAEXAAV?$basic_ostream@DU?$char_traits@D@std@@@std@@@Z) already defined in camera.obj
matrix.obj : error LNK2005: "public: virtual void __thiscall boost::unit_test::output::compiler_log_formatter::log_build_info(class std::basic_ostream<char,struct std::char_traits<char> > &)" (?log_build_info@compiler_log_formatter@output@unit_test@boost@@UAEXAAV?$basic_ostream@DU?$char_traits@D@std@@@std@@@Z) already defined in camera.obj
.
.
.
In my files is the following: matrix.cpp
#define BOOST_TEST_MODULE example
#include <boost/test/included/unit_test.hpp>

//____________________________________________________________________________//


BOOST_AUTO_TEST_CASE( test_matrix1 )
{
	BOOST_CHECK( 1 == 0 );
}

//____________________________________________________________________________//

BOOST_AUTO_TEST_CASE( test_matrix2 )
{
	BOOST_CHECK_EQUAL( 0, 0 );
}

//____________________________________________________________________________//

camera.cpp
#include <boost/test/included/unit_test.hpp>

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!