环境 Ubuntu7.10 + KDevelop 3.5.0 + QT4
用KDevelop创建工程过程如下:
Project->New Project->C++->Simple Hello world program
其他默认.
删除main函数后
输入如下代码:
#include <iostream>
#include <cstdlib>
#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();
}
在Automake Manager ->Options(with RMB)
在Inludes里的Directories outside project里添加
-I/usr/include/qt4/QtCore
-I/usr/include/qt4/QtGui
-I/usr/include/qt4
F8编译后还是出现以下错误:
error: QApplication: No such file or directory
error: QLabel: No such file or directory
: In function ‘int main(int, char**)’:
error: ‘QApplication’ was not declared in this scope
error: expected `;' before ‘app’
error: ‘QLabel’ was not declared in this scope
error: ‘label’ was not declared in this scope
error: expected type-specifier before ‘QLabel’
error: expected `;' before ‘QLabel’
error: ‘app’ was not declared in this scope
请问大家怎么解决,小弟感激涕零......
[问题]QT4路径问题
-
- 帖子: 1
- 注册时间: 2007-05-30 13:52
- marsteel
- 帖子: 555
- 注册时间: 2005-11-28 12:09
- 联系: