title: C++ Undefined Reference to vtable and inheritance
body: <p>File A.h</p>
  
  <pre><code>#ifndef A_H_
  #define A_H_
  
  class A {
  public:
      virtual ~A();
      virtual void doWork();
  };
  
  #endif
  </code></pre>
  
  <p>File Child.h</p>
  
  <pre><code>#ifndef CHILD_H_
  #define CHILD_H_
  
  #include "A.h"
  
  class Child: public A {
  private:
      int x,y;
  public:
      Child();
      ~Child();
      void doWork();
  };
  #endif
  </code></pre>
  
  <p>And Child.cpp </p>
  
  <pre><code>#include "Child.h"
  
  Child::Child(){
      x = 5;
  }
  
  Child::~Child(){...}
  
  void Child::doWork(){...};
  </code></pre>
  
  <p>The compiler says that there is a undefined reference to vtable for <code>A</code>.
  I have tried lots of different things and yet none have worked.</p>
  
  <p>My objective is for class <code>A</code> to be an Interface, and to seperate implementation code from headers.</p>