#注:以下操作方法按先后顺序依次执行。经测试在安装了Qt 4.5 X11版和arm交叉编译环境的Ubuntu 9.04上可正常通过
#编译安装tslib 1.4到/usr/local/tslib:
./autogen.sh
echo ac_cv_func_malloc_0_nonnull=yes>arm-linux.cache
./configure --host=arm-linux --prefix=/usr/local/tslib --cache-file=arm-linux.cache --enable-inputapi=no
make&&make install
#将/usr/local/tslib目录复制到目标机/usr/local/目录下后,设置如下环境变量:
export TSLIB_ROOT=/usr/local/tslib
export TSLIB_TSDEVICE=/dev/input/event0
export TSLIB_CALIBFILE=/etc/pointercal
export TSLIB_CONFFILE=$TSLIB_ROOT/etc/ts.conf
export TSLIB_PLUGINDIR=$TSLIB_ROOT/lib/ts
export TSLIB_CONSOLEDEVICE=none
export TSLIB_FBDEVICE=/dev/fb0
export QWS_MOUSE_PROTO=Tslib:/dev/input/event0
export LD_LIBRARY_PATH=$TSLIB_ROOT/lib:$LD_LIBRARY_PATH
#编译安装Qt 4.5.3到/usr/local/Trolltech/QtEmbedded-4.5.3-arm(默认路径):
#执行命令将arm-linux-gcc添加到PATH:
export PATH=/usr/local/arm/arm-926ejs-linux/bin:$PATH
#编译安装
./configure -release -shared -opensource -fast -no-largefile -qt3support -no-svg -no-webkit -no-scripttools -xplatform qws/linux-arm-g++ -embedded arm -qt-gfx-linuxfb -no-gfx-transformed -no-gfx-multiscreen -no-gfx-vnc -no-gfx-qvfb -no-kbd-tty -no-kbd-usb -no-kbd-sl5000 -no-kbd-yopy -no-kbd-vr41xx -no-kbd-qvfb -qt-libtiff -little-endian -qt-libpng -no-libmng -qt-libjpeg -no-openssl -qt-freetype -no-opengl -make libs -make tools -nomake examples -nomake docs -nomake demo -no-glib -no-cups -no-nis -no-mouse-qvfb -qt-mouse-tslib -I /usr/local/tslib/include -L /usr/local/tslib/lib
make&&make install
#设置PC机开发环境:
export PATH=/usr/local/arm/arm-926ejs-linux/bin:$PATH
export QTDIR=/usr/local/Trolltech/QtEmbedded-4.5.3-arm
export PATH=$QTDIR/bin:$PATH
export LD_LIBRARY_PATH=$QTDIR/lib:$LD_LIBRARY_PATH
export QMAKESPEC=$QTDIR/mkspecs/qws/linux-arm-g++
#将/usr/local/Trolltech/QtEmbedded-4.5.3-arm/lib下的需要的库文件和所需要的字体复制到目标机/qt/qt/lib目录,设置网关环境变量:
export QTDIR=/qt/qt
export LD_LIBRARY_PATH=$QTDIR/lib:$LD_LIBRARY_PATH
export QT_QWS_FONTDIR=$QTDIR/lib/fonts
#在$QTDIR/lib/fonts目录下创建fontdir文件设置Qt程序的字体。下面示例是微软黑体,大小为12到30偶数号,样式为普通和加粗。字体文件simhei.ttf从windows系统中复制到$QTDIR/lib/fonts文件夹
#调用黑体16号普通字体的方法示例:QFont("simhei",16,50,false):
simhei simhei.ttf FT n 50 120 u
simhei simhei.ttf FT n 50 140 u
simhei simhei.ttf FT n 50 160 u
simhei simhei.ttf FT n 50 180 u
simhei simhei.ttf FT n 50 200 u
simhei simhei.ttf FT n 50 220 u
simhei simhei.ttf FT n 50 240 u
simhei simhei.ttf FT n 50 260 u
simhei simhei.ttf FT n 50 280 u
simhei simhei.ttf FT n 50 300 u
simhei simhei.ttf FT n 75 120 u
simhei simhei.ttf FT n 75 140 u
simhei simhei.ttf FT n 75 160 u
simhei simhei.ttf FT n 75 180 u
simhei simhei.ttf FT n 75 200 u
simhei simhei.ttf FT n 75 220 u
simhei simhei.ttf FT n 75 240 u
simhei simhei.ttf FT n 75 260 u
simhei simhei.ttf FT n 75 280 u
simhei simhei.ttf FT n 75 300 u
在arm+linux平台编译Qt4.5.3和tslib1.4
最新推荐文章于 2021-08-20 07:48:21 发布