分页: 1 / 1

qt新手问题

发表于 : 2009-08-06 21:45
tinnarong
还是经典的hello qt,
helloqt.cpp:2:17: 错误: QLable:没有该文件或目录
helloqt.cpp: In function ‘int main(int, char**)’:
helloqt.cpp:6: 错误: ‘QLable’在此作用域中尚未声明
helloqt.cpp:6: 错误: ‘lable’在此作用域中尚未声明
helloqt.cpp:6: 错误: expected type-specifier before ‘Lable’
helloqt.cpp:6: 错误: expected `;' before ‘Lable’
google过了,按照网上说的检查qmake 版本,我的是4.5,然后也检查过makefile里的路径,/usr/include/qt4/确下有QApplication和QLabel
还行哪位指教下

Re: qt新手问题

发表于 : 2009-08-06 21:53
tinnarong

代码: 全选

#include <QApplication>
#include <QLabel>

int main(int argc, char *argv[])
 {
     QApplication app(argc, argv);
    QLabel *label = new QLabel("Hello Qt!");
    label->show();
   return app.exec();
 }

Re: qt新手问题

发表于 : 2009-08-07 15:41
dbzhang800
tinnarong 写了:还是经典的hello qt,
helloqt.cpp:2:17: 错误: QLable:没有该文件或目录
helloqt.cpp: In function ‘int main(int, char**)’:
helloqt.cpp:6: 错误: ‘QLable’在此作用域中尚未声明
helloqt.cpp:6: 错误: ‘lable’在此作用域中尚未声明
helloqt.cpp:6: 错误: expected type-specifier before ‘Lable’
helloqt.cpp:6: 错误: expected `;' before ‘Lable’
google过了,按照网上说的检查qmake 版本,我的是4.5,然后也检查过makefile里的路径,/usr/include/qt4/确下有QApplication和QLabel
还行哪位指教下
你确定你上面贴的代码就是你实际用的吗?
Label != Lable

Re: qt新手问题

发表于 : 2009-08-07 19:10
ChloeRei
我编译通过了,也没遇过这个问题,所以观望了……

编译过程是什么样的,是不是
qmake -project
qmake
make
删掉.pro再试一遍

Re: qt新手问题

发表于 : 2009-09-24 10:45
176266956
label写错了,注意E跟L的位置。