• 7083阅读
  • 4回复

QT4  Head Lib 路径问题 [复制链接]

上一主题 下一主题
离线qianyimao
 

只看楼主 倒序阅读 楼主  发表于: 2007-10-21
QT4  Head Lib 路径问题
— 本帖被 XChinux 执行加亮操作(2008-06-13) —
环境 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

请问大家怎么解决,小弟感激涕零......
离线marsteel
只看该作者 1楼 发表于: 2007-10-24
我刚解决了这个问题,等我睡醒写篇blog图解一下   
KDevelop真是方便啊
To infinity and beyond
离线zhangjianjun
只看该作者 2楼 发表于: 2007-11-21
引用第1楼marsteel于2007-10-24 03:29发表的  :
我刚解决了这个问题,等我睡醒写篇blog图解一下[表情]  [表情]  [表情]
KDevelop真是方便啊


I am interesting in your resolution.
离线aiming0420
只看该作者 3楼 发表于: 2009-03-07
Re:QT4  Head Lib 路径问题
贱人,你睡醒了没????
离线wd007

只看该作者 4楼 发表于: 2009-03-07
Re:QT4  Head Lib 路径问题
你的路径要设置的,在工程选项里面。

qmake 的

还有一些环境变量在安装好Qt后就要设置好
欢迎访问我的博客,一起学习提高
http://blog.csdn.net/qter_wd007
快速回复
限100 字节
 
上一个 下一个