虛擬機中安裝ubuntu及搭建Qt開發環境

1.安裝vmwareplayer。
2.安裝ubuntu。
3.安裝vi。sudo apt-get install vim
4.安裝GCC。sudo apt-get install build-essential
5.arm-linux-gcc(64位系統可能需要安裝32位兼容庫)。

比較老一點的系統,比如ubuntu 12.04,可以用命令

sudo apt-get install ia32-libs

更新一些的ubuntu系統需要使用

sudo apt-get install libc6:i386

sudo apt-get install lib32z1


6.編譯tslib
#!/bin/bash
chmod +x autogen.sh configure
./autogen.sh
./configure --prefix=/opt/tslib --host=arm-fsl-linux-gnueabi ac_cv_func_mall    oc_0_nonnull=yes
make
echo "Done! Now you can install tslib by typing the following command:"
echo "sudo chmod 777 /opt; make install" 

7.編譯qt-arm4.7.3
#!/bin/sh 
(echo yes) | \
./configure \
         -prefix /opt/qt-4.7.3                                    \
        -opensource -confirm-license -release -embedded arm      \
         -xplatform qws/linux-arm-gnueabi-g++ -no-qt3support      \
         -depths 16,18,24,32 -no-qvfb -no-svg -no-cups -no-mmx    \
         -no-3dnow -no-sse -no-sse2 -no-glib -no-openssl -shared  \
         -no-largefile -no-accessibility -no-xrender -no-webkit   \
         -no-gtkstyle -nomake examples -nomake docs -nomake demos \
         -little-endian                                           \
         -fast -lrt -qt-mouse-tslib                               \
         -qt-freetype                                             \
         -D QT_QWS_CLIENTBLIT                                     \
         -I /opt/tslib/include                                    \
         -L /opt/tslib/lib 

#make -j8 #for 4-Cores CPU
#make install

8.安裝NFS
安裝NFS服務器
sudo apt-get install nfs-kernel-server
安裝NFS客戶端
sudo apt-get install nfs-common
添加共享目錄
sudo vi /etc/exports
/nfsroot *(rw,sync,no_root_squash)
創建目錄,設置權限
sudo mkdir /nfsroot
sudo chmod -R 777 /nfsroot
sudo chown –R nobody /nfsroot
啓動NFS服務器
sudo /etc/init.d/nfs-kernel-server start

9.安裝Qt。sudo apt-get install qt-sdk
10.Qtcreator設置交叉編譯器。Qtcreator版本不同方式有差異,Qtcreator2.4.1的中設置方法:
菜單Tools-->Options-->Build & Run-->Tool Chains-->Add-->GCCE
編譯器選擇arm-none-linux-gnueabi-g++
調試器選擇arm-none-linux-gnueabi-gdb

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章