qt新手问题

软件和网站开发以及相关技术探讨
回复
tinnarong
帖子: 9
注册时间: 2009-05-19 23:12

qt新手问题

#1

帖子 tinnarong » 2009-08-06 21:45

还是经典的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
还行哪位指教下
tinnarong
帖子: 9
注册时间: 2009-05-19 23:12

Re: qt新手问题

#2

帖子 tinnarong » 2009-08-06 21:53

代码: 全选

#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();
 }
dbzhang800
帖子: 3182
注册时间: 2006-03-10 15:10
来自: xi'an China
联系:

Re: qt新手问题

#3

帖子 dbzhang800 » 2009-08-07 15:41

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
头像
ChloeRei
帖子: 1021
注册时间: 2007-11-23 9:49

Re: qt新手问题

#4

帖子 ChloeRei » 2009-08-07 19:10

我编译通过了,也没遇过这个问题,所以观望了……

编译过程是什么样的,是不是
qmake -project
qmake
make
删掉.pro再试一遍
176266956
帖子: 11
注册时间: 2009-01-03 22:13

Re: qt新手问题

#5

帖子 176266956 » 2009-09-24 10:45

label写错了,注意E跟L的位置。
回复