Boost unit_test.cpp problem when try to compile simple program

I tried to use Boost test module in my project but I have a little problem. When I try to compile simple program: #define BOOST_TEST_MAIN #include <boost/test/included/unit_test.hpp> it fails to compile on Visual Studio 2008 with three errors: c:\program files (x86)\boost\boost_1_39\boost\test\impl\exception_safety.ipp(513) : error C2491: 'boost::itest::exception_safety' : definition of dllimport function not allowed c:\program files (x86)\boost\boost_1_39\boost\test\impl\logged_expectations.ipp(228) : error C2491: 'boost::itest::logged_expectations' : definition of dllimport function not allowed c:\program files (x86)\boost\boost_1_39\boost\test\impl\unit_test_main.ipp(174) : error C2491: 'boost::unit_test::unit_test_main' : definition of dllimport function not allowed On Linux machines everything works OK. So, anybody could help me with that? Need more data? Robert

Robert Matusewicz <matekm <at> gmail.com> writes:
I tried to use Boost test module in my project but I have a little problem. When I try to compile simple program:
#define BOOST_TEST_MAIN #include <boost/test/included/unit_test.hpp>
it fails to compile on Visual Studio 2008 with three errors:
How do you compile it? What is command line? The only way these even remotely possible if BOOST_TEST_DYN_LINK is defined somewhere. Gennadiy

Robert Matusewicz <matekm <at> gmail.com> writes:
The only way these even remotely possible if BOOST_TEST_DYN_LINK is defined somewhere.
Gennadiy
Yes, Yes - I link to dynamic Boost and use BOOS_ALL_DYN_LINK. There is no way to use Boost.Test with dynamic linking?
You need different include than. Can't have it both ways. Either you include library implementation or you link with it. Use boost/test/unit_test.hpp
participants (2)
-
Gennadiy Rozental
-
Robert Matusewicz