I am working in a project based on the lib cppunit, I need to run my tests with qttestrunner
I make the libqttestrunnerd.a (qmake qttestrunnerlib.pro and make ), obviously there is a problem of linking, here is a sample of output:
/home/oumaya/docs/UT_Cpp_Test/main/cppDir/lib/lib/libqttestrunnerd.a(moc_testbrowserdlg.o):(.rodata._ZTV15TestBrowserBase[vtable for TestBrowserBase]+0x30): undefined reference to 'QWidget::setName(char const*)'
/home/oumaya/docs/UT_Cpp_Test/main/cppDir/lib/lib/libqttestrunnerd.a(moc_testbrowserdlg.o):(.rodata._ZTV15TestBrowserBase[vtable for TestBrowserBase]+0x34): undefined reference to 'QObject::insertChild(QObject*)'
there is a lot of similar messages related to QT objects.
any help please
thank you in advance.
When working with qt and you get
undefined reference to ...usually that means you are inheriting a class and not implementing its virtual functions. Check the documentation(s) for the Qt class(es) you are inheriting and find out which of its functions are virtual and implement them in your class.