Skip to content


A QT Project – Fractal Generator – The vtable Strikes Back

I wrote a more detailed summary about this error in this post

Uhhhh. This vtable game with qmake really sucks. I just started to introduce menu points, tool bar buttons etc. to Arthur and wanted to connect the action signals to handler slots. I created a new class for that, which was derived from QObject. Then in order to connect signals I added slots to the new class. When we declare signals and slots in a class we have to use the Q_OBJECT macro. And the madness starts…

OK. As you probably guessed I got the good old vtable error. I new that everything was fine with my class. I cleaned the environment with make clean. I deleted the Makefile. I rerun qmake. About 1000 times with modifications here and there. The problem was the moc stuff was not included to the Makefile. I didn’t know why. Fortunately I had another project using signals and slots and it was linking well. I started to strip both projects by removing and renaming files and continuously trying qmake and checking the generated Makefiles. Finally I ended up with two projects which were apparently identical. One worked the other didn’t. Then I found what was the problem. I compared the project files. In the arthur.pro I had a wrong qmake variable name for the include file list. I used INCLUDES instead of HEADERS. Aaaah. It didn’t case problem so far! Not even a single warning from the tools and it is already the 8th version of the project!

Now it compiles and links well. Version 008 is coming soon :)

Posted in Arthur Fractal Generator, QT Programming.

Tagged with , , , , .