undefined symbol: typeinfo for <class>
-
i have a header file where i declare a class derived from
QObject
and withQ_OBJECT
macro.
the class is an interface class (with a lot of slots), so i don't have a source file.when i derive a class from the interface, i get a runtime error:
undefined symbol: typeinfo for <class>
if i add a blank source file with just#include "interface.h"
statement, everything works.i think that when i include the
"interface.h"
in my"class.h"
, then include the"class.h"
in"class.cpp"
, moc should be fine and generate the moc file, right? so what am i missing? -
I'm pretty sure that you ARE breaking the MOC by not having a source file. The inability of Qt to define a Q_OBJECT class completely in a header file is a known limitation...at least known to me. LOL
On a sidenote. I don't believe a QObject derived class can be a pure abstract class since QObject itself is not an interface but rather a concrete class.