在/etc/profile中设置了
QTDIR=/usr/local/Trolltech/Qt-4.3.1
PATH=/usr/local/Trolltech/Qt-4.3.1/bin:$PATH
MANPATH=$QTDIR/man:$MANPATH
LD_LIBRARY_PATH=$QTDIR/lib:$LD_LIBRARY_PATH
export QTDIR PATH MANPATH LD_LIBRARY_PATH
然后在hello程序目录下运行时出错了,苦思不得其解,请帮忙解决,谢谢
[root@qinj hello]# dir
hello.cpp hello.pro Makefile
[root@qinj hello]# make
g++ -c -pipe -Wall -W -O2 -march=i386 -mcpu=i686 -g -DGLX_GLXEXT_LEGACY -fno-use-cxa-atexit -fno-exceptions -DQT_NO_DEBUG -I/usr/lib/qt-3.1/mkspecs/default -I. -I. -I/usr/local/Trolltech/Qt-4.3.1/include -o hello.o hello.cpp
hello.cpp:1:24: QApplication: No such file or directory
hello.cpp:2:18: QLabel: No such file or directory
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: `QLabel' 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