[Qt-creator] undefined reference to vtable for <Class Name> - happens in RC1

Ernst Huber swmail01 at systest.ch
Tue Feb 10 12:51:44 CET 2009


This topic was already discussed in this thread:

http://lists.trolltech.com/pipermail/qt-creator/2008-November/000412.html

I still get this linker error with Qt Creator RC1 on WinXP/MingW.

As soon as a new class added to a project inherits from QObject and uses 
the Q_OBJECT macro the build fails.

Example:

    class ViewAdapter : public QObject

    {

        Q_OBJECT

        Q_DISABLE_COPY(ViewAdapter)

         .

         .
         .


Error message is:


undefined reference to 'vtable for ViewAdapter '


Solving the problem:

- "Clean Project" doesn't help
- MUST unload and reopen the project. After this the build succeeds.

Ernst







More information about the Qt-creator-old mailing list