When using QT programming, when a user customizes a class, a signal or slot is used as long as the class.
Code::Blocks compile will error (undefined reference to ' vtable for).
There are many answers to this question on Google, but many of them are vague or not feasible at all.
In fact, QT has its own method of compiling.
Without the IDE writing a class, QT compiles the steps:
1, CD source code directory
2, Qmake-project
3, Qmake Project_name.pro
4, make (if you have MinGW, use Mingw-make.exe)
In view of this, we add 3 items in Code::Blocks tools-->config tools-->add See figure:
Note: The first character of all paramiters above must be a space.
Once setup is complete, compile the project as long as you do this:
Tools--> Select Qmake-project, wait finished-select Qmake, wait finished-select Mingw-make, wait complete.
This completes the compilation.
Note: All source code must be placed in the root directory of the project.
You also need to make environment variables:
In path add: E:\QT\bin; E:\CodeBlocks\MinGW\bin
Of course, these are absolute paths and you need to change them to the path on your computer.
http://zxwmail.blog.163.com/blog/static/120947384201091911557185/
Qt "undefined reference to ' vtable for" Error resolution (manual resolution, deeper understanding)