MY-IMX Linux-4.1.15 QT5 Program Build Manual
来自明远智睿的wiki
Admin(讨论 | 贡献)2018年8月15日 (三) 16:46的版本 (创建页面,内容为“ [^_^]: MY-IMX Linux-4.1.15 QT5 Program compilation manual <br/> ### Compile the host environment ---------------------------------------------------------...”)
目录
Compile the host environment
- Compile the host CPU architecture: 64-bit
- Compile the host system: Linux
- Linux distribution: Ubuntu
- Ubuntu version number: 14.04.5
- Ubuntu version type: desktop version
- Ubuntu system type: x86-64
Installing the SDK
Download SDK
Download the SDK package file in the "2.3_System_Linux-4.1.15/03_Tools" directory of the network disk.
MY-IMX6EK140、MY-IMXEK40P:fsl-imx-fb-glibc-x86_64-meta-toolchain-qt5-cortexa7hf-neon-toolchain-4.1.15-2.1.0.sh
MY-IMX6EK200、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
Install SDK (MY-IMX6EK140, MY-IMXEK40P example)
- Copy the downloaded package file to the compiled host.
- Modify the permissions of the pre-installation directory
$ chmod 777 /opt -R
- Install the SDK package file
$ ./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
- Create oe-device-extra.pri file to prevent error when calling 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.pri
Compile the QT application
Configuring cross compilation tool environment variables
$ source /opt/fsl-imx-fb/4.1.15-2.1.0/environment-setup-cortexa7hf-neon-poky-linux-gnueabi
Compile the QT Demo program
- Download QT Demo source package
Download myzr-qt5-demo.tar on the network disk "2.3_ system _linux-4.1.15/05_my-demo" and copy it to the compiler host. - Unzip QT Demo source package
$ tar xf myzr-qt5-demo.tar
- Enter the QT Demo project directory
$ cd myzr-qt5-demo/AboutUs
- Create makefiles for the project
$ qmake
- Compilation project
$ 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=co ...... 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 -lpthread
- View the compiled target file
$ 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
Running target program
- Copy the compiled AboutUs to the evaluation board.
- Execution target program
$ ./AboutUs -platform eglfs -plugin evdevtouch:/dev/input/event0 QEglFSVivIntegration will set environment variable FB_MULTI_BUFFER=2 to enable double buffering and vsync. If this is not desired, you can override this via: export QT_EGLFS_IMX6_NO_FB_MULTI_BUFFER=1 Unable to query physical screen size, defaulting to 100 dpi. To override, set QT_QPA_EGLFS_PHYSICAL_WIDTH and QT_QPA_EGLFS_PHYSICAL_HEIGHT (in millimeters).
-------------------------------------------------------------------------------- * ZhuHai MYZR Technology CO.,LTD. * Latest Update: 2018/08/15 * Supporter: Tang Bin --------------------------------------------------------------------------------