Unresolved external symbol "public: virtual struct QMetaObject const * __thiscall Parent

后端 未结 23 2333
醉话见心
醉话见心 2020-11-30 21:33

I inherited a class from QObject :

class Parent: public QObject
{
    Q_OBJECT
    QObject* cl;

public:
    Parent(QObject *parent=0):QObject(parent) {
            


        
23条回答
  •  再見小時候
    2020-11-30 22:10

    I use CMake to manage Qt projects and the new Q_OBJECT needs to be added under the QT4_WRAP_CPP call. This will generate the moc_*.cxx for inclusion in the project and clean up the unresolved externals.

提交回复
热议问题