qt4头文件的问题
各位好心人:
我装的是qt4.3.2
我设置的环境变量是/etc/profile
PATH=/usr/local/Trolltech/Qt-4.3.4/bin:$PATH
3. QTDIR=/usr/local/Trolltech/Qt-4.3.4
4. MANPATH=$QTDIR/man:$MANPATH
5. LD_LIBRARY_PATH=$QTDIR/lib:$LD_LIBRARY_PATH
6. export PATH QTDIR MANPATH LD_LIBRARY_PATH
同样,qmake也默认为QT4的也一样,重定向链接。
1. sudo rm /usr/bin/designer
2. sudo ln -s /usr/local/Trolltech/Qt-4.3.4/bin/designer /usr/bin/designer
3. sudo rm /usr/bin/qmake
4. sudo ln -s /usr/local/Trolltech/Qt-4.3.4/bin/qmake /usr/bin/qmake
我编的程序是
#include <QApplication.h>
#include <QLable.h>
int main(int argc,char *argv[])
{
QApplication app(argc,argv);
QLable *label = new QLable("Hello Qt!");
label->show();
return app.exe();
}
编译用
qmake -project ,qmake hello.pro.之后用make
可是
[root@localhost hello]# make
g++ -c -pipe -O2 -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I../mkspecs/linux-g++ -I. -I../include/QtCore -I../include/QtCore -I../include/QtGui -I../include/QtGui -I../include -I. -I. -I.
-o hello.o hello.cpp
hello.cpp:1:26: QApplication.h: 没有那个文件或目录
hello.cpp:2:20: QLable.h: 没有那个文件或目录
hello.cpp: In function `int main(int, char**)':
hello.cpp:6: `QApplication' undeclared (first use this function)
hello.cpp:6: (Each undeclared identifier is reported only once for each
function it appears in.)
hello.cpp:6: parse error before `(' token
hello.cpp:7: `QLable' undeclared (first use this function)
hello.cpp:7: `label' undeclared (first use this function)
hello.cpp:7: parse error before `(' token
hello.cpp:9: `app' undeclared (first use this function)
hello.cpp:5: warning: unused parameter `int argc'
hello.cpp:5: warning: unused parameter `char**argv'
make: *** [hello.o] Error 1
头文件找不到
请问兄弟们
这咋办啊