title: How to properly solve the "undefined reference to vtable" error?
body: <p>I've read the FAQ and several other websites about this, but I can't seem to find the proper solution. I'm quite sure you've heard the question before, and I'd like to ask for specific help as to how I should solve this, if possible.</p>
  
  <p>The specific error is:
  error: undefined reference to `vtable for FGui'
  It always points to the constructor in fgui.cpp, but I don't see anything that could be wrong with it.</p>
  
  <p>FGui is a class inherited from a class named "FFoo", which is inherited from QMainWindow.
  Relevant code:</p>
  
  <p>(In ffoo.h:)</p>
  
  <pre><code>class Ffoo : public QMainWindow
  {
  Q_OBJECT
  public:
      Ffoo();
      ~Ffoo();
      (...)
  };
  </code></pre>
  
  <p>(In ffoo.cpp:)</p>
  
  <pre><code>Ffoo::Ffoo()
  {
      textEdit = 0;
      tcpSock = 0;
      setupConnectBox();
  }
  
  Ffoo::~Ffoo()
  {}
  </code></pre>
  
  <p>The FGui files are still very plain, since I only started making the class recently.</p>
  
  <p>(fgui.h:)</p>
  
  <pre><code>class FGui : public Ffoo
  {
      Q_OBJECT
  public:
      FGui();
      ~FGui();
  };
  </code></pre>
  
  <p>(fgui.cpp:)</p>
  
  <pre><code>FGui::FGui() : Ffoo()
  {}
  
  FGui::~FGui()
  {}
  </code></pre>
  
  <p>If anybody can tell me what to do to solve this, I would be very grateful. Thanks in advance. :)</p>