作者:海纳百川2602902033 | 来源:互联网 | 2023-10-11 11:47
Qt:qt-everywhere-opensource-src-4.6.0.tar.gz
嵌入式平台:2440
arm-linux-gcc:4.1.2,下载(我用4.3.2和4.4.1版本时,移植时都有段错误。我把它放在:/usr/local/arm/4.1.2/ 。)
将 qt-everywhere-opensource-src-4.6.0.tar.gz 压缩包解压为3份,分别编译 PC ,嵌入式 x86 和 arm 三个版本。
1. 编译 PC 版:
$ ./configure
$ make
# make install
2. 编译嵌入式x86版:
$ ./configure -embedded x86 -qt-gfx-qvfb -qt-kbd-qvfb -qt-mouse-qvfb
$ make
# make install
编译安装PC版中的 qvfb:
$ cd ***/qt-everywhere-opensource-src-4.6.0/tools/qvfb
$ make
# cp ***/qt-everywhere-opensource-src-4.6.0/bin/qvfb /usr/local/Trolltech/QtEmbedded-4.6.0/bin
3. 编译嵌入式arm版(需要 arm-linux-gcc 的支持):
编译tslib对触摸屏支持:
下载,tslib1.4.tar.gz,解压后:
$ ./configure --prefix=/usr/local/tslib/ --host=arm-linux ac_cv_func_malloc_0_nOnnull=yes
$ make
# make install
设置环境变量,以便编译时找到相关的库:
$ export CPLUS_INCLUDE_PATH=/usr/local/arm/4.1.2/arm-angstrom-linux-gnueabi/include/c++:/usr/local/arm/4.1.2/arm-angstrom-linux-gnueabi/include/c++/arm-angstrom-linux-gnueabi
配置:
$ ./configure \
-opensource \
-confirm-license \
-release -shared \
-embedded arm \
-xplatform qws/linux-arm-g++ \
-depths 16,18,24 \
-fast \
-optimized-qmake \
-pch \
-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 \
-qt-mouse-tslib -I/usr/local/tslib/include -L/usr/local/tslib/lib