我安裝qt-sdk後
安裝在/opt/qtsdk-2009.02
參數我也設定好了
debian:~# PATH=$PATH:/opt/qtsdk-2009.01/bin
debian:~# PATH=$PATH/opt/qtsdk-2009.01/qt/bin
debian:~# echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/qtsdk-2009.01/bin/opt/qtsdk-2009.01/qt/bin
然後我編寫一個hello.cpp的範例
之後我做下面幾個步驟
debian:~/hello# qmake -project
debian:~/hello# qmake
debian:~/hello# make
g++ -c -pipe -O2 -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtGui -I/usr/include/qt4 -I. -I. -I. -o hello.o hello.cpp
g++ -o hello hello.o -L/usr/lib -lQtGui -lQtCore -lpthread
debian:~/hello# ls
hello hello.cpp hello.o hello.pro Makefile
然後我執行hello
debian:~/hello# ./hello
hello: cannot connect to X server
他出現這個問題請問我該如何解決??