还是经典的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
还行哪位指教下
qt新手问题
-
- 帖子: 9
- 注册时间: 2009-05-19 23:12
Re: qt新手问题
代码: 全选
#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();
}
-
- 帖子: 3182
- 注册时间: 2006-03-10 15:10
- 来自: xi'an China
- 联系:
Re: qt新手问题
你确定你上面贴的代码就是你实际用的吗?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新手问题
我编译通过了,也没遇过这个问题,所以观望了……
编译过程是什么样的,是不是
qmake -project
qmake
make
删掉.pro再试一遍
编译过程是什么样的,是不是
qmake -project
qmake
make
删掉.pro再试一遍
-
- 帖子: 11
- 注册时间: 2009-01-03 22:13
Re: qt新手问题
label写错了,注意E跟L的位置。