title: Undefined reference to vtable. Trying to compile a Qt project
body: <p>I'm using <a href="http://en.wikipedia.org/wiki/Code::Blocks" rel="noreferrer">Code::Blocks</a> 8.02 and the mingw 5.1.6 compiler. I'm getting this error when I compile my Qt project:</p>
  
  <blockquote>
    <p>C:\Documents and Settings\The
    Fuzz\Desktop\GUI\App_interface.cpp|33|undefined
    reference to `vtable for AddressBook'</p>
  </blockquote>
  
  <p>File AddressBook.h:</p>
  
  <pre><code> #ifndef ADDRESSBOOK_H
   #define ADDRESSBOOK_H
  
   #include &lt;QWidget&gt;
  
   class QLabel;
   class QLineEdit;
   class QTextEdit;
  
   class AddressBook : public QWidget
   {
       Q_OBJECT
  
   public:
       AddressBook(QWidget *parent = 0);
  
   private:
       QLineEdit *nameLine;
       QTextEdit *addressText;
   };
  
   #endif
  </code></pre>
  
  <p>File AddressBook.cpp:</p>
  
  <pre><code>#include &lt;QtGui&gt;
  #include "addressbook.h"
  
  AddressBook::AddressBook(QWidget *parent)
       : QWidget(parent)
  {
      QLabel *nameLabel = new QLabel(tr("Name:"));
      nameLine = new QLineEdit;
  
      QLabel *addressLabel = new QLabel(tr("Address:"));
      addressText = new QTextEdit;
  
      QGridLayout *mainLayout = new QGridLayout;
      mainLayout-&gt;addWidget(nameLabel, 0, 0);
      mainLayout-&gt;addWidget(nameLine, 0, 1);
      mainLayout-&gt;addWidget(addressLabel, 1, 0, Qt::AlignTop);
      mainLayout-&gt;addWidget(addressText, 1, 1);
  
      setLayout(mainLayout);
      setWindowTitle(tr("Simple Address Book"));
  }
  </code></pre>