首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 移动开发 > QT开发 >

关于QT Designer生成的ui文件,make 时候总提示"undefined reference to `vtable for"解决方

2012-04-10 
关于QT Designer生成的ui文件,make 时候总提示undefined reference to `vtable for我用QT Designer 生成

关于QT Designer生成的ui文件,make 时候总提示"undefined reference to `vtable for"
我用QT Designer 生成了的.ui文件,然后用一个类继承了QDialog 和 makefile 生成的 .ui 对应的C++ 文件,编译总是提示"undefined reference to `vtable for" 这个错误! 贴上代码,求帮忙看下,谢谢!

C/C++ code
#ifndef GOCELL_H#define GOCELL_H#include <QDialog>#include "ui_gocell.h"class GoCell : public QDialog, public Ui::ToCellDialog{   Q_OBJECT    public:        GoCell(QWidget *parent = 0);  private slots:        void on_lineEdit_textChanged();};#endif

C/C++ code
#include <QApplication>#include "gocell.h"GoCell :: GoCell(QWidget *parent) : QDialog(parent){    setupUi(this);    QRegExp regExp("[A-Za-z][0-9]{0, 2}");    lineEdit->setValidator(new QRegExpValidator(regExp, this));    connect(okButton, SIGNAL(clicked()), this, SLOT(accept()));    connect(cancelButton, SIGNAL(clicked()), this, SLOT(reject()));}void GoCell::on_lineEdit_textChanged(){    okButton->setEnabled(lineEdit->hasAcceptableInput());}

C/C++ code
#include <QApplication>#include "gocell.h"int main(int argc, char* argv[]){    QApplication app(argc, argv);    GoCell *dialog = new GoCell;    dialog->show();    return app.exec();}

编译提示:“undefined reference to `vtable for GoCell'” 
ps:ui_gocell.h 这个头文件是用makefile生成的。求帮忙解决,谢谢了

[解决办法]
重新rcc uic moc,全部编译呢?
[解决办法]
楼主可以看看http://blog.csdn.net/chenlong12580/article/details/7431104

热点排行