When compiling my test suite againts cppunit, I get the following linking error:
error LNK2019: unresolved external symbol "public: virtual __thiscall CppUnit::TextTestRunner::~TextTestRunner(void)" (??1TextTestRunner@CppUnit@@UAE@XZ) referenced in function _wmain
I don't understand this problem as the provided examples link fine.
I am using the macros to register my test:
CPPUNIT_TEST_SUITE_REGISTRATION
CPPUNIT_TEST_SUITE
etc
My test class is derived from CPPUNIT_NS::TestFixture
and here is the 'main' code:
int _tmain(int argc, _TCHAR* argv[])
{
// Get the top level suite from the registry
CPPUNIT_NS::Test *suite = CPPUNIT_NS::TestFactoryRegistry::getRegistry().makeTest();
// Adds the test to the list of test to run
CPPUNIT_NS::TextUi::TestRunner runner;
runner.addTest( suite );
// Change the default outputter to a compiler error format outputter
runner.setOutputter( new CPPUNIT_NS::CompilerOutputter( &runner.result(),
CPPUNIT_NS::stdCOut() ) );
// Run the test.
bool wasSucessful = runner.run();
// Return error code 1 if the one of test failed.
return wasSucessful ? 0 : 1;
}