0

単体テストに cppunit を使用するプロジェクトがあります。QTtestrunner を使用して結果を表示しました。コードは次のとおりです。

CPPUNIT_NS::QtUi::TestRunner testrunner;  
testrunner.addTest (CPPUNIT_NS::TestFactoryRegistry::getRegistry().makeTest());
testrunner.run (true);

しかし、コンパイル時に次のメッセージが表示されます:

src/main.cpp:78: undefined reference to 'CppUnit::QtTestRunner::QtTestRunner()'
src/main.cpp:79: undefined reference to CppUnit::QtTestRunner::addTest(CppUnit::Test*)'                 
src/main.cpp:80: undefined reference to CppUnit::QtTestRunner::run(bool)'
src/main.cpp:91: undefined reference to 'CppUnit::QtTestRunner::~QtTestRunner()'

リンクに問題があることはわかっていますが、必要なものはすべて libcppunit.a と libcppunit.so に含めています。

4

1 に答える 1