Ubuntu 10.04 下安装Qt 4.7.1[未完成]

1. 下载qt-everywhere-opensource-src-4.7.1.tar.gz,地址为 http://get.qt.nokia.com/qt/source/qt-everywhere-opensource-src-4.7.1.tar.gz

 

 

2. 执行下面脚本:

 

sudo apt-get install libfontconfig1-dev libfreetype6-dev libx11-dev libxcursor-dev libxext-dev libxfixes-dev libxft-dev libxi-dev libxrandr-dev libxrender-dev
tar zxvf qt-everywhere-opensource-src-4.7.1.tar.gz
cd qt-everywhere-opensource-src-4.7.1/
./configure -opensource -confirm-license -prefix /opt/Qt-4.7.1 -qvfb
make
sudo make install
cd tools/qvfb/
cp ../shared/deviceskin/deviceskin.* ./
qmake -project
qmake
sudo sed -i 's/LIBS          = $(SUBLIBS)/LIBS          = $(SUBLIBS) -lXtst/g' Makefile
sudo apt-get libxext-dev
make
sudo make install
cp qvfb /opt/Qt-4.7.1/bin/
cd ../../
make clean
make confclean
./configure -opensource -confirm-license -release -shared -prefix /opt/QtEmbedded-4.7.1 -embedded arm -xplatform qws/linux-arm-g++ -depths 4,8,16,32 -fast -optimized-qmake -qt-sql-sqlite -qt-libjpeg -qt-zlib -qt-libpng -qt-freetype -little-endian -host-little-endian -no-qt3support -no-libtiff -no-libmng -no-opengl -no-mmx -no-sse -no-sse2 -no-3dnow -no-openssl -no-webkit -no-qvfb -no-phonon -no-nis -no-opengl -no-cups -no-glib -no-xcursor -no-xfixes -no-xrandr -no-xrender -no-separate-debug-info -nomake examples -nomake tools -nomake docs -D__ARM_ARCH_5TEJ__ -qt-mouse-tslib -I/opt/tslib/include -L/opt/tslib/lib
make
sudo make install

 

3. gedit ~/.bashrc &
添加以下内容:
export PATH=/opt/Qt-4.7.1/bin:$PATH
export PATH=/opt/QtEmbedded-4.7.1/bin:$PATH

 

至此,安装完成。在板子上运行需要将下面文件拷贝到板子的lib目录下:

/opt/QtEmbedded-4.7.1/lib/libQtCore.so.4
/opt/QtEmbedded-4.7.1/lib/libQtCore.so.4.7.1
/opt/QtEmbedded-4.7.1/lib/libQtGui.so.4
/opt/QtEmbedded-4.7.1/lib/libQtGui.so.4.7.1
/opt/QtEmbedded-4.7.1/lib/libQtNetwork.so.4
/opt/QtEmbedded-4.7.1/lib/libQtNetwork.so.4.7.1

 

可以使用脚本:

cp /opt/QtEmbedded-4.7.1/lib/libQtCore* ~/opt/lib
cp /opt/QtEmbedded-4.7.1/lib/libQtGui* ~/opt/lib
cp /opt/QtEmbedded-4.7.1/lib/libQtNetwork* ~/opt/lib

然后将~/opt/lib通过NFS装载到板子上的/opt/QtEmbedded-4.7.1/lib目录下

 

另外,需要设置板子上的环境变量:

export QTEDIR=/opt/QtEmbedded-4.7.1
export QTDIR=$QTEDIR
export PATH=$QTDIR/bin:$PATH
export LD_LIBRARY_PATH=$QTDIR/lib:$LD_LIBRARY_PATH
export QWS_MOUSE_PROTO=tslib:/dev/ts

 

编译测试程序如下:

cd /opt/QtEmbedded-4.7.1/demos/books

qmake

make

生成books文件

将books文件拷贝到s3c2410上执行books -qws,出现下列错误:

Qtig:r:Agmn isn:"po/1ee  3 �
Qtig:r:Agmn isn:"po/1ee  3 �
Qtig:r:Agmn isn:%ted,/
Qtig:r:Agmn isn:"1qebde-2   ?????
Cno raeQ o meddLnxdt ietr:%ted
Abort

 

原因未知,以后再说吧

你可能感兴趣的:(ubuntu,脚本,qt,Path,library,books)