当前位置:网站首页>'function vtable for error: undefined reference to ... ' 问题的原因及解决方法
'function vtable for error: undefined reference to ... ' 问题的原因及解决方法
2022-07-29 05:26:00 【sg-expert】
QT中,类要支持信号与槽机制,需要继承自QObject并在头文件开头添加Q_OBJECT宏.
如果使用QtCreator创建类时,没有选择继承自QObject类或其子类,而在创建后手工修改继承自QObject并手工添加Q_OBJECT宏,则在编译时有可能会出现"function vtable for error: undefined reference to … " 错误.
解决方法: 把新创建的类文件从项目中移除(不要从磁盘上删除),然后再添加进项目工程,QtCreator就会重新解析此类,再编译就不再会出现上述错误.
边栏推荐
- 将源码包转换为rpm包
- IGMP protocol software development experiment
- Using STP spanning tree protocol to solve the problem of two-layer loop in network
- Vivado IP核之复数浮点数乘法 Floating-point
- 关于DDoS的几个误区
- Common server faults and their solutions
- 8、 Network security
- 七、 下一代互联网IPV6
- day12_多线程
- Circular linked list and bidirectional linked list
猜你喜欢
day06_ Classes and objects
软件测试职业发展:软件测试人员该何去何从
Hongke automation SoftPLC | modk operation environment and construction steps (1) -- Introduction to operation environment
day15_泛型
day02_ Basic grammar
Software testing career development: where should software testers go
Vivado IP核之复数浮点数除法 Floating-point
六、 网络互联与互联网
Hongke automation SoftPLC | Hongke kPa modk operation environment and construction steps (2) -- modk operation environment construction
浅谈缺陷描写样式
随机推荐
How to judge whether a business is attacked by DDoS? What harm will it cause?
Right value reference and mobile construction
TCP based online dictionary
Inventory | major network security events of global key information infrastructure
Hongke education you want to enter the field of TSN? Hongke teaches you how to build TSN test system
网站受DDoS攻击的表现以及查看方法
day09_ Static & Final & code block & abstract class & Interface & internal class
day17_ Under collection
浅谈缺陷描写样式
Hongke automation SoftPLC | Hongke kPa modk operation environment and construction steps (2) -- modk operation environment construction
软件测试职业发展:软件测试人员该何去何从
Hongke share | FPGA implementation of pass through and store and forward switching delay
三、广域通信网
Ultra low cost DDoS attacks are coming. See how WAF protects Jedi
Idea installing Scala
Hongke shares | why EtherCAT is the best solution to improve the performance of the control system?
软件测试的优势有哪些?看看你了解多少.....
案例补充、ATM
9、 Networking technology
Traffic characteristics of webshell management tools