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

后端 未结 23 2306
醉话见心
醉话见心 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:29

    I know that this is a very old question, but it seems to be still interesting (I've been here at least 4 or 5 times in the last months) and seems like I found another reason for which is possible to get this error.

    In my case in the header file I wrongly typed:

    #include "MyClass.h""
    

    Only after inspecting the whole output I found out that at that line the compiler was emitting a warning.

    Now that I removed the additional quotation mark my QObject compiles perfectly!

提交回复
热议问题