title: A missing vtable usually means the first non-inline virtual member function has no definition
body: <p>I am pretty sure this question is duplicate, but my code is different here, the following is my code. It fails with a "Undefined symbols" error, not sure whats missing.</p>
  
  <pre><code>class Parent {
     public :
       virtual int func () = 0;
       virtual ~Parent();
  
   };
  
  
   class Child : public Parent {
       public :
  
       int data;
       Child (int k) {
          data = k;
        }
      int func() {   // virtual function
         cout&lt;&lt;"Returning square of 10\n";
          return 10*10;
      }
  
      void Display () {
      cout&lt;&lt;data&lt;&lt;"\n";
  
   }
  
   ~ Child() {
  
      cout&lt;&lt;"Overridden Parents Destructor \n";
  
   }
  };
  
  
  
  int main() {
    Child a(10);
   a.Display();
  
   }
  </code></pre>
  
  <p>The following is the O/P when compiled.</p>
  
  <pre><code>Undefined symbols for architecture x86_64:
    "Parent::~Parent()", referenced from:
        Child::~Child() in inher-4b1311.o
    "typeinfo for Parent", referenced from:
        typeinfo for Child in inher-4b1311.o
    "vtable for Parent", referenced from:
        Parent::Parent() in inher-4b1311.o
    NOTE: a missing vtable usually means the first non-inline virtual member function has no definition.
  </code></pre>