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 復制到評估板上。
總結
以上是生活随笔為你收集整理的linux qt手册,明远智睿I.MX6 Linux-4.1.15 QT5 程序编译手册的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: php 查文件sha1 内存不足,SHA
- 下一篇: linux 内核io操作,关于Linux