Qt4.8.7交叉编译环境搭建

一.用虚拟机安装ubuntu-14.04.4-desktop-amd64.iso或者Ubuntu16.04.3

二.apt-get update
apt-get install vim ssh (可不用)

三.安装32位兼容库:
apt-get install libc6:i386 libstdc++6:i386 libncurses5:i386 zlib1g:i386

四. 配置交叉编译环境
下载arm-gcc: gcc-4.6.2-glibc-2.13-linaro-mutlilib-2011.12.tar.bz2到系统~目录并解压缩
tar –jxvf gcc-4.6.2-glibc-2.13-linaro-mutlilib-2011.12.tar.bz2 –C /opt
编辑/etc/profile文件增加
export PATH=$PATH:/opt/gcc-4.6.2-glibc-2.13-linaro-multilib-2011.12/fsl-linaro-toolchain/bin
source /etc/profile 使修改的变量生效

五. 编译安装tslib

  1. 安装工具:
    apt-get install automake libtool g++ g+±multilib lib32z1

2.创建tslib目录
mkdir /usr/local/tslib目录

3.下载tslib: tslib-1.4.tar.gz 到~
tar xvf tslib-1.4.tar.gz
cd tslib
./autogen.sh
./configure CC=arm-linux-gcc CXX=arm-linux-g++ --prefix=/usr/local/tslib --host=arm-linux ac_cv_func_malloc_0_nonnull=yes
make
sudo make install

4.将/usr/local/tslib/etc/ts.conf文件第二行“#module_raw input”注释去掉,变为“module_raw input”,注意一定要顶格
arm-none-linux-gnueabi-
输入上面指令按两次tab键,如果出现列表说明配置成功
或将编译好的tslib.tar.bz2 解压缩,拷贝到/usr/local/tslib目录.

六, 安装QT

1.创建目录: sudo mkdir /usr/local/qt4.8.5-arm

  1. 下载qt-everywhere-opensource-src-4.8.5.zip到~并解压缩
    unzip –a qt-everywhere-opensource-src-4.8.5.zip (不要用提取,后续编译会出现问题)
    cd qt-everywhere-opensource-src-4.8.5

vim mkspecs/qws/linux-arm-g++/qmake.conf
将arm-linux-全部并加上-lts,然后保存退出
改完如下:
include(…/…/common/linux.conf)
include(…/…/common/gcc-base-unix.conf)
include(…/…/common/g+±unix.conf)
include(…/…/common/qws.conf)

modifications to g++.conf

QMAKE_CC = arm-linux-gcc -lts
QMAKE_CXX = arm-linux-g++ -lts
QMAKE_LINK = arm-linux-g++ -lts
QMAKE_LINK_SHLIB = arm-linux-g++ -lts

modifications to linux.conf

QMAKE_AR = arm-linux-ar cqs
QMAKE_OBJCOPY = arm-linux-objcopy
QMAKE_STRIP = arm-linux-strip

load(qt_config) 运行下面三条指令中的任意一条(一般我运行的第二条)

./configure --prefix=/usr/local/qt4.8.5-arm -opensource -release -shared -Declarative -importdir /opt/imports -fast -no-largefile -qt-sql-sqlite -qt3support -exceptions -xmlpatterns -no-glib -no-phonon -no-mmx -no-3dnow -no-sse -no-sse2 -svg -no-webkit -qt-zlib -qt-libtiff -qt-libpng -qt-libjpeg -make libs -make tools -nomake examples -nomake docs -nomake demo -no-nis -no-cups -iconv -no-dbus -xplatform qws/linux-arm-g++ -embedded arm -little-endian -qt-freetype -depths 16,24,32 -qt-gfx-linuxfb -qt-gfx-transformed -qt-gfx-multiscreen -no-gfx-vnc -no-gfx-qvfb -qt-kbd-linuxinput -no-kbd-qvfb -armfpa -no-mouse-qvfb -qt-mouse-linuxtp -qt-mouse-tslib -DQT_QLOCALE_USES_FCVT -DQT_NO_QWS_CURSOR -no-pch -I/usr/local/tslib/include -L/usr/local/tslib/lib -confirm-license
(ok)

./configure --prefix=/usr/local/qt4.8.5-arm -opensource -release -shared -Declarative -importdir /opt/imports -fast -no-largefile -qt-sql-sqlite -qt3support -exceptions -xmlpatterns -no-glib -no-phonon -no-mmx -no-3dnow -no-sse -no-sse2 -svg -no-webkit -qt-zlib -qt-libtiff -qt-libpng -qt-libjpeg -make libs -make tools -nomake examples -nomake docs -nomake demo -no-nis -no-cups -iconv -no-dbus -xplatform qws/linux-arm-g++ -embedded arm -little-endian -qt-freetype -depths 16,24,32 -qt-gfx-linuxfb -qt-gfx-transformed -qt-gfx-multiscreen -no-gfx-vnc -no-gfx-qvfb -qt-kbd-linuxinput -no-kbd-qvfb -armfpa -no-mouse-qvfb -no-mouse-linuxtp -qt-mouse-tslib -DQT_QLOCALE_USES_FCVT -DQT_NO_QWS_CURSOR -no-pch -I/usr/local/tslib/include -L/usr/local/tslib/lib -confirm-license

./configure --prefix=/usr/local/Tr/qt4.8.5-arm -opensource -release -shared -Declarative -importdir /opt/imports -fast -no-largefile -qt-sql-sqlite -qt3support -exceptions -xmlpatterns -no-glib -no-mmx -no-3dnow -no-sse -no-sse2 -svg -no-webkit -qt-zlib -qt-libtiff -qt-libpng -qt-libjpeg -make libs -make tools -nomake examples -nomake docs -nomake demo -no-nis -no-cups -iconv -no-dbus -xplatform qws/linux-arm-g++ -embedded arm -little-endian -qt-freetype -depths 16,24,32 -qt-gfx-linuxfb -qt-gfx-transformed -qt-gfx-multiscreen -no-gfx-vnc -no-gfx-qvfb -qt-kbd-linuxinput -no-kbd-qvfb -armfpa -no-mouse-qvfb -no-mouse-linuxtp -qt-mouse-tslib -qt-mouse-pc -DQT_QLOCALE_USES_FCVT -DQT_NO_QWS_CURSOR -no-pch -I/usr/local/tslib/include -L/usr/local/tslib/lib -confirm-license

下面蓝色内容为开发板上需要配置的内容
-qt-mouse-linuxinput, 支持电容屏
-qt-mouse-linuxinput 支持Linux input子系统的鼠标驱动

-qt-mouse-pc
-qt-mouse-linuxtp
-qt-mouse-linuxinput
-plugin-mouse-linuxtp
-plugin-mouse-pc

-qt-mouse-tslib -qt-mouse-pc -no-mouse-linuxtp

-no-mouse-pc -no-mouse-qvfb -no-mouse-linuxtp -no-mouse-qnx -qt-mouse-linuxinput -qt-mouse-tslib
-qt-mouse-tslib -qt-mouse-linuxinput -qt-mouse-pc -no-mouse-linuxtp

make
sudo make install

  1. 配置QT变量环境
    export PATH= P A T H : / u s r / l o c a l / q t 4.8.5 − a r m / b i n e x p o r t L D L I B R A R Y
  • 0
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值