title: Unresolved external symbol "public: virtual struct QMetaObject const * __thiscall Parent
body: <p>I inherited a class from QObject : </p>
  
  <pre><code>class Parent: public QObject
  {
      Q_OBJECT
      QObject* cl;
  
  public:
      Parent(QObject *parent=0):QObject(parent) {
          cl = NULL;
      }
  
      QObject* getCl() const {
          return cl;
      }
      void setCl(QObject *obj) {
          cl = obj;
      }
  };
  </code></pre>
  
  <p>But when I write :</p>
  
  <pre><code>Parent ev;
  </code></pre>
  
  <p>I get the following error:</p>
  
  <pre><code>main.obj:-1: error: LNK2001: unresolved external symbol "public: virtual struct QMetaObject const * __thiscall Parent::metaObject(void)const " (?metaObject@Parent@@UBEPBUQMetaObject@@XZ)
  
  main.obj:-1: error: LNK2001: unresolved external symbol "public: virtual void * __thiscall Parent::qt_metacast(char const *)" (?qt_metacast@Parent@@UAEPAXPBD@Z)
  
  main.obj:-1: error: LNK2001: unresolved external symbol "public: virtual int __thiscall Parent::qt_metacall(enum QMetaObject::Call,int,void * *)" (?qt_metacall@Parent@@UAEHW4Call@QMetaObject@@HPAPAX@Z)
  </code></pre>