0
當編譯我的測試套件反對票的CppUnit,我得到了鏈接錯誤如下:CppUnit的鏈接錯誤
error LNK2019: unresolved external symbol "public: virtual __thiscall CppUnit::TextTestRunner::~TextTestRunner(void)" ([email protected]@@[email protected]) referenced in function _wmain
爲提供的實例鏈接罰款我不明白這個問題。
我使用宏來註冊我的測試:
CPPUNIT_TEST_SUITE_REGISTRATION
CPPUNIT_TEST_SUITE
etc
我的測試類是從 CPPUNIT_NS ::的TestFixture
,這裏是 '主' 代碼衍生:
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;
}
做到了這一點,沒有快樂 – cbrulak 2009-01-29 18:42:04