• 4137阅读
  • 2回复

QT编译错误?什么原因呢? [复制链接]

上一主题 下一主题
离线chenyuntian
 

只看楼主 倒序阅读 楼主  发表于: 2009-05-11
1>f:\test3\test3\test3.h(16) : error C2039: 'test3Class' : is not a member of 'Ui'
1>f:\test3\test3\test3.h(16) : error C2143: syntax error : missing ';' before '.'
1>f:\test3\test3\test3.h(16) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>f:\test3\test3\test3.h(16) : error C2238: unexpected token(s) preceding ';'
1>.\test3.cpp(6) : error C2065: 'ui' : undeclared identifier
1>.\test3.cpp(6) : error C2228: left of '.setupUi' must have class/struct/union
1>        type is ''unknown-type''
1>main.cpp
1>f:\test3\test3\test3.h(16) : error C2039: 'test3Class' : is not a member of 'Ui'
1>f:\test3\test3\test3.h(16) : error C2143: syntax error : missing ';' before '.'
1>f:\test3\test3\test3.h(16) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>f:\test3\test3\test3.h(16) : error C2238: unexpected token(s) preceding ';'
1>Generating Code...
1>生成日志保存在“file://f:\test3\test3\Debug\BuildLog.htm”
1>test3 - 10 个错误,0 个警告
========== 生成: 0 已成功, 1 已失败, 0 最新, 0 已跳过 ==========


#ifndef TEST3_H
#define TEST3_H

#include <QtGui/QMainWindow>
#include "ui_test3.h"

class test3 : public QMainWindow
{
    Q_OBJECT

public:
    test3(QWidget *parent = 0, Qt::WFlags flags = 0);
    ~test3();

private:
    Ui::test3Class.ui;
};

#endif // TEST3_H

另外在自动生成的文件如果删除了.刚编译通过的程序也会报错.如何恢复删除的生成文件呢?
离线jawiudi
只看该作者 1楼 发表于: 2009-05-11
Ui::test3Class.ui;
输入有误,怎么是“.”?
离线chenyuntian

只看该作者 2楼 发表于: 2009-05-12
呵呵.找到原因了.改名了对话框名.
快速回复
限100 字节
 
上一个 下一个