How to solute it ? the error message(undefined reference to `vtable for XXX') is displayed when creating a slot & signal.
1.write your class in the header file.
ex. cw.h
2. using moc to generate cpp(implementation file)
E:\Projects\CodeBlocks\qt_ex2>D:\Qt\5.12.0\mingw73_64\bin\moc.exe cw.h > cw.cpp
3.include the define file in your code file(ex. include "cw.h")