Qt编译错误:undefined reference to vtable for xxx 问题 › 分类: Questions › Qt编译错误:undefined reference to vtable for xxx 1 赞 踩 admin 管理员 asked 2月 ago Qt编译时候出现如下错误提示:undefined reference to vtable for xxx 1 Answers 1 赞 踩 最佳答案 admin 管理员 answered 2月 ago 出现此错误大概率是在类定义的h文件使用了Q_OBJECT宏后出现的,尝试以下方式解决: 1)在类实现cpp文件底部添加 #include “moc_className.cpp” ; 2)将工程先清除一次,然后QtCreator中选择执行qmake,再进行重新编译;