title: Undefined symbol vtable
body: <p>Compiling Qt cpp code and receiving this error:</p>
  
  <pre><code>Running ld for x86_64 ...
  Undefined symbols for architecture x86_64:
    "vtable for HelixButton", referenced from:
        HelixButton::HelixButton(QString const&amp;, QWidget*) in helixQtCmd.o
        HelixButton::HelixButton(QString const&amp;, QWidget*) in helixQtCmd.o
    NOTE: a missing vtable usually means the first non-inline virtual member function has no definition.
  </code></pre>
  
  <p>my .h file looks like:</p>
  
  <pre><code>class HelixButton : public QPushButton
  {
      Q_OBJECT
  
  public:
              HelixButton(const QString&amp; text, QWidget* parent = 0);
      virtual ~HelixButton();
  };
  </code></pre>
  
  <p>and the corresponding cpp:</p>
  
  <pre><code>HelixButton::HelixButton(const QString&amp; text, QWidget* parent)
  :   QPushButton(text, parent)
  {}
  
  HelixButton::~HelixButton()
  {}
  </code></pre>
  
  <p>The pro file contains the proper header:</p>
  
  <pre><code>include(qtconfig)
      INCLUDEPATH += /Users/laurent/Dropbox/Dev/Maya/qt/include
      INCLUDEPATH += /Users/laurent/Dropbox/Dev/Maya/qt/include/QtGui
      INCLUDEPATH += /Users/laurent/Dropbox/Dev/Maya/qt/include/QtCore
      INCLUDEPATH += /Users/laurent/Dropbox/Dev/Maya/qt/include/QtUiTools
  
  TARGET = helixQtCmd
  HEADERS += helixQtCmd.h
  SOURCES += helixQtCmd.cpp
  </code></pre>
  
  <p>Contents of the qtconfig file:</p>
  
  <pre><code>TEMPLATE = lib
  CONFIG -= debug
  CONFIG += qt warn_on plugin
  
  _DEVKIT_LOCATION = $$(MAYA_LOCATION)/../../devkit
  _MAYA_INCLUDE_DIR = $${_DEVKIT_LOCATION}/include
  
  DEFINES     += CC_GNU_ OSMac_ OSMacOSX_ Bits32_  REQUIRE_IOSTREAM \
              OSMac_MachO_ _LANGUAGE_C_PLUS_PLUS 
  INCLUDEPATH += .. "$${_MAYA_INCLUDE_DIR}"
  TARGET_EXT  = bundle
  QMAKE_EXTENSION_SHLIB   = bundle
  
  QMAKE_CC    = clang
  QMAKE_CXX   = clang++
  
  _CFLAGS     = -O3 -include "$${_MAYA_INCLUDE_DIR}/maya/OpenMayaMac.h"
  QMAKE_CFLAGS    += $${_CFLAGS}
  
  QMAKE_CXXFLAGS  += $${_CFLAGS} -stdlib=libstdc++ $(WARNFLAGS) $(ERROR_FLAGS) \
              -fno-gnu-keywords -fpascal-strings
  
  _DYNLIB_LOCATION    = $$(MAYA_LOCATION)/MacOS
  _LREMAP         = -Wl,-executable_path,"$${_DYNLIB_LOCATION}"
  
  LIBS        += -L"$${_DYNLIB_LOCATION}" $${_LREMAP} -lOpenMaya -lFoundation \
              -framework System -framework CoreServices \
              -framework SystemConfiguration \
              -framework Carbon -framework Cocoa \
              -framework ApplicationServices \
              -framework IOKit \
              -framework QtCore \
              -framework QtGui
  
  QMAKE_LFLAGS    += -stdlib=libstdc++ -fno-gnu-keywords -fpascal-strings  \
              -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk -bundle
  
  QMAKE_LINK      = $${QMAKE_CXX}
  QMAKE_MAC_SDK   = /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk
  
  MAKEFILE = $${TARGET}.mak
  </code></pre>
  
  <p>Reading multiple articles on internet show an issue with the destructor declaration, but it seems correct.<p>Removing Q_OBJECT makes it work, but i really need signals.<p>
  No moc file is generated upon compilation.<p>Any clue what could go wrong ?<p>Thanks </p>