linux qt手册,明远智睿I.MX6 Linux-4.1.15 QT5 程序编译手册

明远智睿I.MX6 Linux-4.1.15 QT5 程序编译手册

[复制链接]

编译主机环境编译主机CPU架构:64位

编译主机系统:Linux

Linux发行版:Ubuntu

Ubuntu版本号:14.04.5

Ubuntu版本类型:桌面版

Ubuntu系统类型:x86-64

安装 SDK下载 SDK

在网盘“2.3_系统_Linux-4.1.15/03_工具”目录中下载 SDK 包文件。MY-IMX6-EK140、MY-IMX-EK40P:

fsl-imx-fb-glibc-x86_64-meta-toolchain-qt5-cortexa7hf-neon-toolchain-4.1.15-2.1.0.shMY-IMX6-EK200、MY-IMX-EK314、MY-IMX-EK336:

fsl-imx-fb-glibc-x86_64-meta-toolchain-qt5-cortexa9hf-neon-toolchain-4.1.15-2.1.0.sh准备安装把下载的包文件复制到编译主机中。

修改预安装目录的权限$ chmod 777 /opt -RSDK 安装(MY-IMX6-EK140、MY-IMX-EK40P)安装 SDK 包文件$ ./fsl-imx-fb-glibc-x86_64-meta-toolchain-qt5-cortexa7hf-neon-toolchain-4.1.15-2.1.0.sh Freescale i.MX Release Distro SDK installer version 4.1.15-2.1.0 ================================================================ Enter target directory for SDK (default: /opt/fsl-imx-fb/4.1.15-2.1.0): You are about to install the SDK to "/opt/fsl-imx-fb/4.1.15-2.1.0". Proceed[Y/n]? Y Extracting SDK.......................................................................................................................................................done Setting it up...done SDK has been successfully set up and is ready to be used. Each time you wish to use the SDK in a new shell session, you need to source the environment setup script e.g. $ . /opt/fsl-imx-fb/4.1.15-2.1.0/environment-setup-cortexa7hf-neon-poky-linux-gnueabi创建 oe-device-extra.pri 文件防止 qmake 时报错$ touch /opt/fsl-imx-fb/4.1.15-2.1.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi/usr/lib/qt5/mkspecs/oe-device-extra.priSDK 安装(MY-IMX6-EK200、MY-IMX-EK314、MY-IMX-EK336)安装 SDK 包文件$ ./fsl-imx-fb-glibc-x86_64-meta-toolchain-qt5-cortexa9hf-neon-toolchain-4.1.15-2.1.0.sh Freescale i.MX Release Distro SDK installer version 4.1.15-2.1.0 ================================================================ Enter target directory for SDK (default: /opt/fsl-imx-fb/4.1.15-2.1.0): You are about to install the SDK to "/opt/fsl-imx-fb/4.1.15-2.1.0". Proceed[Y/n]? Y Extracting SDK..............................................................................................................................................................done Setting it up...done SDK has been successfully set up and is ready to be used. Each time you wish to use the SDK in a new shell session, you need to source the environment setup script e.g. $ . /opt/fsl-imx-fb/4.1.15-2.1.0/environment-setup-cortexa9hf-neon-poky-linux-gnueabi创建 oe-device-extra.pri 文件防止 qmake 时报错touch /opt/fsl-imx-fb/4.1.15-2.1.0/sysroots/cortexa9hf-neon-poky-linux-gnueabi/usr/lib/qt5/mkspecs/oe-device-extra.pri

编译 QT 应用程序配置交叉编译工具环境变量MY-IMX6-EK140、MY-IMX-EK40P$ source /opt/fsl-imx-fb/4.1.15-2.1.0/environment-setup-cortexa7hf-neon-poky-linux-gnueabiMY-IMX6-EK200、MY-IMX-EK314、MY-IMX-EK336$ source /opt/fsl-imx-fb/4.1.15-2.1.0/environment-setup-cortexa9hf-neon-poky-linux-gnueabi准备编译工程下载 QT Demo 源码包

在网盘“2.3_系统_Linux-4.1.15/05_MY-Demo”中下载 myzr-qt5-demo.tar 并复制到编译主机中。

解压 QT Demo 源码包$ tar xf myzr-qt5-demo.tar进入 QT Demo 工程目录$ cd myzr-qt5-demo/AboutUs为工程生成 Makefile$ qmake编译工程MY-IMX6-EK140、MY-IMX-EK40P$ make /opt/fsl-imx-fb/4.1.15-2.1.0/sysroots/x86_64-pokysdk-linux/usr/bin/qt5/uic widget.ui -o ui_widget.h ...... arm-poky-linux-gnueabi-g++ -march=armv7ve -mfpu=neon -mfloat-abi=hard -mcpu=cortex-a7 --sysroot=/opt/fsl-imx-fb/4.1.15-2.1.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -Wl,-O1 -o AboutUs main.o widget.o qrc_source.o moc_widget.o -lQt5Widgets -lQt5Gui -lQt5Core -lGLESv2 -lEGL -lpthreadMY-IMX6-EK200、MY-IMX-EK314、MY-IMX-EK336$ make /opt/fsl-imx-fb/4.1.15-2.1.0/sysroots/x86_64-pokysdk-linux/usr/bin/qt5/uic widget.ui -o ui_widget.h ...... arm-poky-linux-gnueabi-g++ -march=armv7-a -mfpu=neon -mfloat-abi=hard -mcpu=cortex-a9 --sysroot=/opt/fsl-imx-fb/4.1.15-2.1.0/sysroots/cortexa9hf-neon-poky-linux-gnueabi -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -Wl,-O1 -o AboutUs main.o widget.o qrc_source.o moc_widget.o -lQt5Widgets -lQt5Gui -lQt5Core -lGLESv2 -lEGL -lpthread目标可执行文件查看编译生成的目标文件$ file AboutUs AboutUs: ELF 32-bit LSB executable, ARM, EABI5 version 1 (GNU/Linux), dynamically linked, interpreter /lib/ld-linux-armhf.so.3, for GNU/Linux 2.6.32, BuildID[sha1]=38367b0a95b8fe7402e2377c11626581c07f9c9d, not stripped

运行目标程序

1.把编译生成的 AboutUs 复制到评估板上。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值