參考:http://blog.csdn.net/newnewman80/article/details/6286271
一、安裝qt-opensource
1、解壓qt-x11-opensource-src-4.5.3.tar.gz到相關目錄
2、進入相關目錄,執行# ./configure ,之後選擇o,提示錯誤Basic XLib function test failed !You might need to modify the include and library search paths by editing QMA; 解決:沒有安裝libtst-dev ,apt-get install libxtst-dev;
3、執行# gmake 提示錯誤:gmake命令未找到,網上說gmake就是make,但是執行make提示錯誤,沒想相關的makefile文件,原因還是第一步的執行沒有成功,重新執行上面一步,然後# make,需要很長時間,
4、# make install ;
5、在qt解壓的根目錄下建立shell文件qt_x11_setenv.Sh,內容爲:
#!bin/bash
PATH=/usr/local/Trolltech/Qt-4.5.3/bin:$PATH
QTDIR=/usr/local/Trolltech/QT-4.5.3
MAINPATH=$QTDIR/man:$MAINPATH
LD_LIBRARY_PATH=$QTDIR/lib:$LD_LIBRARY_PATH
export PATH QTDIR MAINPATH LD_LIBRARY_PATH
echo " set qt-x11 env. successful "
6、保存退出,在終端執行# source qt_x11_setenv.Sh,終端回顯:set qt-x11 env. Successful;
7、# echo $QTDIR 回顯:/usr/local/Trolltech/QT-4.5.3 說明環境變量設置成功;
二、、安裝Qt-Creator集成開發環境
1、下載安裝程序:qt-creator-linux-x86-opensource-1.3.0.Bin
2、# ./ qt-creator-linux-x86-opensource-1.3.0.bin 開始安裝..........;
3、安裝成功後,桌面會有圖標(如果顯示的是一個文件加鎖樣式,則要chmod 777),這時候還不能用,還要設置qmake;
4、打開QtCreator 點擊Tools-->Opention-->Qt4-->Qt Versions 點擊右邊的“+”添加條目,下方的“Version name”中起個名字,關鍵是QMake Location 的選擇,我的位置在:/usr/local/Trolltech/Qt-4.5.3/bin/qmake,然後點擊下方的Rebuild,等會前方的
差號會變成 對號,然後點擊apply ok 搞定!
三、安裝嵌入式Qt編譯程序
1、首先安裝tslib 解壓縮文件到相應的文件夾,進入加壓目錄;
2、# ./autogen.sh 提示錯誤:./autogen.sh: 4: autoreconf: not found 解決:沒有安裝automake 工具 apt-get install automake libtool
3、./configure --prefix=/home/mytslib/ --host=arm-linux ac_cv_func_malloc_0_ nonnull =yes;
4、# make 遇到錯誤
In function ‘open’,
inlined from ‘main’ at ts_calibrate.c:227:11:
/usr/include/bits/fcntl2.h:51:24: error: call to ‘__open_missing_mode’ declare d with attribute error: open with O_CREAT in second argument needs 3 argu ments In function ‘open’,
inlined from ‘main’ at ts_calibrate.c:229:11:
5、# make install 成功後可在/home下生成mytslib,進入mytslib可以看到有bin include lib etc四個文件夾;
6、將qt-embedded-Linux-open-src-4.5.3.tar.gz 解壓到相關目錄(我解壓後剪切到opt/EmbedSky目錄下);
7、進入目錄下,執行 # ./arm_qt4.5_build 提示錯誤:gmake未找到。解決將gmake改爲make;
8、執行# ./arm_qt4.5_build 提示錯誤:沒有makefile 解決,將arm_qt4.5_build 裏的觸摸屏相關路徑(位於-qt-mouse-tslib後面)修改爲: -I/home/mytslib/ include -L/home/mytslib/lib;然後打開環境變量文件# gedit /etc/profile,(profile裏面 有GCC環境變量內容)更新 # source etc/profile;
9、再次執行 # ./arm_qt4.5_build;成功!
10、在QtCreator中新建修改相關的qmake(如上面 二、4 和 圖片所示 路徑位於);....../qt-4.5/__install/arm/bin
這是第二次安裝,仍然耽誤了很長時間,所以這次好好記錄了一下,說的有點複雜,有點亂。
說的有點複雜