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

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

    Visual Studio 2017.

    I've added file to already set up Qt project and got this error. How I fixed it:

    Right click on the header in Solution Explorer Properties... -> Configuration Properties -> General -> Item Type Change from C/C++ Header to Qt Meta-Object Compiler (moc)

    voila :)

提交回复
热议问题