I am trying to practice using Boost unit testing but am faced with a LNK2019 error. This error code haunts me as I rarely know what needs to be done to fix it.
I have the unit testing class set up as basic as I possibly could. I am just trying to make the basic functions work right now so I can go in and create real tests. This is what I have in my cpp:
#include <boost/test/unit_test.hpp>
#define BOOST_TEST_MODULE unit_test
BOOST_AUTO_TEST_CASE(MyTest)
{
BOOST_CHECK(10 == 10);
BOOST_REQUIRE(10 == 11);
}
I have the boost directory included in my C++ project properties, and I have included the stage\lib directory in my Linker Additional Library Directories. I am guessing I have the boost directory included incorrectly, but I am really not sure what I did wrong or how to remedy this. The error is listed below.
Severity Code Line Suppression State Description
Error LNK2019 C:\Users\...\libboost_unit_test_framework-vc142-mt-gd-x32-1_71.lib(unit_test_main.obj) 1 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 __catch$?unit_test_main@unit_test@boost@@YAHP6APAVtest_suite@12@HQAPAD@ZH0@Z$4
Any thoughts?