You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
According to documentation, BOOST_TEST_NO_LIB macro is not required when building multiple translation units in header-only mode, but I get the following error on Windows:
Defining BOOST_TEST_NO_LIB macro in all additional translation units (the ones that include boost/test/unit_test.hpp) fixes the problem. If boost/test/detail/config.hpp cannot be enhanced somehow to fix this problem, then documentation should mention that BOOST_TEST_NO_LIB macro is required for the described case in all additional translation units (or just in all translation units).
There is no problem when project contains only one translation unit (which includes boost/test/included/unit_test.hpp).
Minimum example
Linker settings should not contain path to boost binary libraries to reproduce this problem.
File test_main.cpp:
#defineBOOST_TEST_MODULE My Test
#include<boost/test/included/unit_test.hpp>BOOST_AUTO_TEST_CASE(test1)
{
int i = 1;
BOOST_TEST(i == 1);
BOOST_TEST(i == 2);
}
File test2.cpp:
//#define BOOST_TEST_NO_LIB // uncomment this line to fix link error
#include<boost/test/unit_test.hpp>BOOST_AUTO_TEST_CASE(test2)
{
int i = 2;
BOOST_TEST(i == 1);
BOOST_TEST(i == 2);
}
The text was updated successfully, but these errors were encountered:
According to documentation,
BOOST_TEST_NO_LIB
macro is not required when building multiple translation units in header-only mode, but I get the following error on Windows:Defining
BOOST_TEST_NO_LIB
macro in all additional translation units (the ones that includeboost/test/unit_test.hpp
) fixes the problem. Ifboost/test/detail/config.hpp
cannot be enhanced somehow to fix this problem, then documentation should mention thatBOOST_TEST_NO_LIB
macro is required for the described case in all additional translation units (or just in all translation units).There is no problem when project contains only one translation unit (which includes
boost/test/included/unit_test.hpp
).Minimum example
Linker settings should not contain path to boost binary libraries to reproduce this problem.
File
test_main.cpp
:File
test2.cpp
:The text was updated successfully, but these errors were encountered: