您的位置:首页 > 编程语言 > Qt开发

QT 使用插件系统时,继承纯基类时的奇怪错误

2010-08-31 10:14 295 查看
有一个基类 CLightControl ,定义为QT中的 基类



另一个插件工程中,定义一个子类



编译时发生如下错误

./HBusLightControl.cpp(580) : error C2259: 'CLightControl' : cannot instantiate abstract class
due to following members:

'qint32 CLightControl::QueryStatus(quint32,quint32)' : is abstract
/LightControl/LightControl.h(53) : see declaration of 'CLightControl::QueryStatus'





无数次代码确认后,认定,肯定不是提示的原因导致



换个方向找问题

...





原来~~~~

是这样地...



在继承类的 cpp 文件中,要加上



#include <QtPlugin>





加上后,一切OK!
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: