imx6ullMini开发板qt项目

一、环境配置

添加qmake环境变量(用户级)

vim ~/.bashrc

最后一行加

export PATH=/home/linux/Qt/5.15.0/gcc_64/bin:$PATH

更新

source ~/.bashrc

检查

linux@linux-virtual-machine:~/imx6ull_iot/toolchain/gcc-linaro-4.9.4-2017.01-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/bin$ qmake -v

QMake version 3.1

Using Qt version 5.15.0 in /home/linux/Qt/5.15.0/gcc_64/lib

再检查

linux@linux-virtual-machine:~/imx6ull_dev/ubuntu_sys/ubuntu_rootfs/systemui$ qmake -v

QMake version 3.1

Using Qt version 5.15.0 in /home/linux/Qt/5.15.0/gcc_64/lib

执行qmake

linux@linux-virtual-machine:~/imx6ull_dev/ubuntu_sys/ubuntu_rootfs/systemui$ qmake

Info: creating stash file /home/linux/imx6ull_dev/ubuntu_sys/ubuntu_rootfs/systemui/.qmake.stash

(执行成功)

make

多了ui文件

然后查看systmeui,为x86结构的

进入ui文件执行systemui

会显示qt文件执行结果,只不过是在x86结构上运行的

二、在开发上运行

2.1 我们用**.config**自己编译自己arm的qmake

在qt源码中创建imx6ull.conf文件,编译自己的arm版本的qmake

cpp 复制代码
# imx6ull.conf - 适配IMX6ULL的ARM编译配置
MAKEFILE_GENERATOR      = UNIX
CONFIG                 += incremental
QMAKE_INCREMENTAL_STYLE = sublib

# 绑定你的ARM交叉编译器
QMAKE_CC                = arm-linux-gnueabihf-gcc
QMAKE_CXX               = arm-linux-gnueabihf-g++
QMAKE_LINK              = arm-linux-gnueabihf-g++
QMAKE_LINK_SHLIB        = arm-linux-gnueabihf-g++

# 工具链辅助工具
QMAKE_AR                = arm-linux-gnueabihf-ar cqs
QMAKE_OBJCOPY           = arm-linux-gnueabihf-objcopy
QMAKE_OBJDUMP           = arm-linux-gnueabihf-objdump
QMAKE_STRIP             = arm-linux-gnueabihf-strip

# IMX6ULL架构参数(Cortex-A7,硬件浮点)
QMAKE_CFLAGS           += -march=armv7-a -mtune=cortex-a7 -mfpu=neon-vfpv4 -mfloat-abi=hard -O2
QMAKE_CXXFLAGS         += -march=armv7-a -mtune=cortex-a7 -mfpu=neon-vfpv4 -mfloat-abi=hard -O2

# 绑定你的ARM根文件系统(NFS rootfs)
ROOTFS                  = /home/linux/imx6ull_dev/nfsworkdir/rootfs
QMAKE_INCDIR            = $$ROOTFS/usr/include $$ROOTFS/include
QMAKE_LIBDIR            = $$ROOTFS/usr/lib $$ROOTFS/lib
QMAKE_RPATH             = $$ROOTFS/usr/lib
cpp 复制代码
# 执行配置命令(禁用无用模块,加快编译)   
*****prefix# ARM版Qt安装路径(后续qmake在该路径的bin目录)******

./configure \
    -prefix /home/linux/armqt
    -release \
    -opensource \
    -confirm-license \
    -xplatform linux-arm-gnueabihf-g++ \
    -device linux-imx6-g++ \
    -device-option CROSS_COMPILE=arm-linux-gnueabihf- \
    -sysroot $$ROOTFS \
    -no-opengl \
    -no-cups \
    -no-glib \
    -no-iconv \
    -skip qtwebengine \
    -skip qt3d \
    -skip qtmultimedia \
    -skip qtquick3d \
    -make libs \
    -make tools \
    -nomake examples \
    -nomake tests \
    -v

执行程序的时候会出现以下现象

c为商业版,o为开源版

点击o,点击确认

点击y,点击确认

执行中``````````````````````````````

这里要先安装依赖

OpenGL 依赖缺失(IMX6ULL 无 GPU,需彻底禁用 OpenGL)

即使加了-no-opengl,仍报 OpenGL 测试失败,是因为 Qt 默认会检测 OpenGL 相关依赖,需额外添加-no-gles2 -no-glx -no-eglfs彻底禁用。

cpp 复制代码
sudo apt install gperf libx11-dev libxext-dev libxfixes-dev libxi-dev libxrender-dev libxcb1-dev libx11-xcb-dev libxcb-glx0-dev

如果显示命令错误

执行下面的命令,这里更改了下载目录,更改前缀就是更改下载目录

cpp 复制代码
./configure \
    -prefix /home/linux/imx6ull_dev/nfsworkdir/qt5.12.9-install \
    -device linux-imx6-g++ \
    -device-option CROSS_COMPILE=arm-linux-gnueabihf- \
    -opensource \
    -confirm-license \
    -release \
    -shared \
    -no-opengl \
    -skip qtwebengine \
    -nomake tests \
    -nomake examples \
    -linuxfb \
    -tslib \
    -I/home/linux/imx6ull_dev/nfsworkdir/tslib-1.22/install/include \
    -L/home/linux/imx6ull_dev/nfsworkdir/tslib-1.22/install/lib
cpp 复制代码
make[5]: 离开目录"/home/linux/imx6ull_dev/nfsworkdir/qt_tslib/qt-everywhere-src-5.12.9/qtlocation/src/plugins/geoservices/nokia"
make[4]: 离开目录"/home/linux/imx6ull_dev/nfsworkdir/qt_tslib/qt-everywhere-src-5.12.9/qtlocation/src/plugins/geoservices"
make[3]: 离开目录"/home/linux/imx6ull_dev/nfsworkdir/qt_tslib/qt-everywhere-src-5.12.9/qtlocation/src/plugins"
make[2]: 离开目录"/home/linux/imx6ull_dev/nfsworkdir/qt_tslib/qt-everywhere-src-5.12.9/qtlocation/src"
make[1]: 离开目录"/home/linux/imx6ull_dev/nfsworkdir/qt_tslib/qt-everywhere-src-5.12.9/qtlocation"

编译完成

2.2 使用官方提供的qmake编译工具链

http://www.openedv.com/docs/boards/arm-linux/zdyz-i.mx6ullmini.html#i-mx6u-b

加权限

更新

cpp 复制代码
source /opt/fsl-imx-x11/4.1.15-2.1.0/environment-setup-cortexa7hf-neon-poky-linux-gnueabi

查看

编译

cpp 复制代码
linux@linux-virtual-machine:~/imx6ull_dev/ubuntu_sys/ubuntu_rootfs/systemui$ make -j8
arm-poky-linux-gnueabi-g++  -march=armv7ve -mfpu=neon  -mfloat-abi=hard -mcpu=cortex-a7 --sysroot=/opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi -c -pipe --sysroot=/opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi -O2 -DLINUX=1 -DLINUX=1 -DLINUX=1 -DLINUX=1 -DLINUX=1 -DLINUX=1 -std=gnu++11 -Wall -W -D_REENTRANT -fPIC -DQT_NO_DEBUG -DQT_QUICK_LIB -DQT_GUI_LIB -DQT_QML_LIB -DQT_REMOTEOBJECTS_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -I. -I../server -I/opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi/usr/include/QtQuick -I/opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi/usr/include/QtGui -I/opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi/usr/include/QtQml -I/opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi/usr/include/QtRemoteObjects -I/opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi/usr/include/QtNetwork -I/opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi/usr/include/QtCore -I. -I../Repcs -I/opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi/usr/lib/mkspecs/linux-oe-g++ -o apklistmodel.o apklistmodel.cpp
arm-poky-linux-gnueabi-g++  -march=armv7ve -mfpu=neon  -mfloat-abi=hard -mcpu=cortex-a7 --sysroot=/opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi -c -pipe --sysroot=/opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi -O2 -DLINUX=1 -DLINUX=1 -DLINUX=1 -DLINUX=1 -DLINUX=1 -DLINUX=1 -std=gnu++11 -Wall -W -D_REENTRANT -fPIC -DQT_NO_DEBUG -DQT_QUICK_LIB -DQT_GUI_LIB -DQT_QML_LIB -DQT_REMOTEOBJECTS_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -I. -I../server -I/opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi/usr/include/QtQuick -I/opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi/usr/include/QtGui -I/opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi/usr/include/QtQml -I/opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi/usr/include/QtRemoteObjects -I/opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi/usr/include/QtNetwork -I/opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi/usr/include/QtCore -I. -I../Repcs -I/opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi/usr/lib/mkspecs/linux-oe-g++ -o main.o main.cpp
arm-poky-linux-gnueabi-g++  -march=armv7ve -mfpu=neon  -mfloat-abi=hard -mcpu=cortex-a7 --sysroot=/opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi -c -pipe --sysroot=/opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi -O2 -DLINUX=1 -DLINUX=1 -DLINUX=1 -DLINUX=1 -DLINUX=1 -DLINUX=1 -std=gnu++11 -Wall -W -D_REENTRANT -fPIC -DQT_NO_DEBUG -DQT_QUICK_LIB -DQT_GUI_LIB -DQT_QML_LIB -DQT_REMOTEOBJECTS_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -I. -I../server -I/opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi/usr/include/QtQuick -I/opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi/usr/include/QtGui -I/opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi/usr/include/QtQml -I/opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi/usr/include/QtRemoteObjects -I/opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi/usr/include/QtNetwork -I/opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi/usr/include/QtCore -I. -I../Repcs -I/opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi/usr/lib/mkspecs/linux-oe-g++ -o launchintent.o launchintent.cpp
arm-poky-linux-gnueabi-g++  -march=armv7ve -mfpu=neon  -mfloat-abi=hard -mcpu=cortex-a7 --sysroot=/opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi -c -pipe --sysroot=/opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi -O2 -DLINUX=1 -DLINUX=1 -DLINUX=1 -DLINUX=1 -DLINUX=1 -DLINUX=1 -std=gnu++11 -Wall -W -D_REENTRANT -fPIC -DQT_NO_DEBUG -DQT_QUICK_LIB -DQT_GUI_LIB -DQT_QML_LIB -DQT_REMOTEOBJECTS_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -I. -I../server -I/opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi/usr/include/QtQuick -I/opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi/usr/include/QtGui -I/opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi/usr/include/QtQml -I/opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi/usr/include/QtRemoteObjects -I/opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi/usr/include/QtNetwork -I/opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi/usr/include/QtCore -I. -I../Repcs -I/opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi/usr/lib/mkspecs/linux-oe-g++ -o systemuicommonapiserver.o ../server/systemuicommonapiserver.cpp
arm-poky-linux-gnueabi-g++  -march=armv7ve -mfpu=neon  -mfloat-abi=hard -mcpu=cortex-a7 --sysroot=/opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi -c -pipe --sysroot=/opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi -O2 -DLINUX=1 -DLINUX=1 -DLINUX=1 -DLINUX=1 -DLINUX=1 -DLINUX=1 -std=gnu++11 -Wall -W -D_REENTRANT -fPIC -DQT_NO_DEBUG -DQT_QUICK_LIB -DQT_GUI_LIB -DQT_QML_LIB -DQT_REMOTEOBJECTS_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -I. -I../server -I/opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi/usr/include/QtQuick -I/opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi/usr/include/QtGui -I/opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi/usr/include/QtQml -I/opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi/usr/include/QtRemoteObjects -I/opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi/usr/include/QtNetwork -I/opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi/usr/include/QtCore -I. -I../Repcs -I/opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi/usr/lib/mkspecs/linux-oe-g++ -o qrc_qml.o qrc_qml.cpp
arm-poky-linux-gnueabi-g++  -march=armv7ve -mfpu=neon  -mfloat-abi=hard -mcpu=cortex-a7 --sysroot=/opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi -c -pipe --sysroot=/opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi -O2 -DLINUX=1 -DLINUX=1 -DLINUX=1 -DLINUX=1 -DLINUX=1 -DLINUX=1 -std=gnu++11 -Wall -W -D_REENTRANT -fPIC -DQT_NO_DEBUG -DQT_QUICK_LIB -DQT_GUI_LIB -DQT_QML_LIB -DQT_REMOTEOBJECTS_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -I. -I../server -I/opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi/usr/include/QtQuick -I/opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi/usr/include/QtGui -I/opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi/usr/include/QtQml -I/opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi/usr/include/QtRemoteObjects -I/opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi/usr/include/QtNetwork -I/opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi/usr/include/QtCore -I. -I../Repcs -I/opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi/usr/lib/mkspecs/linux-oe-g++ -o qrc_common.o qrc_common.cpp
arm-poky-linux-gnueabi-g++  -march=armv7ve -mfpu=neon  -mfloat-abi=hard -mcpu=cortex-a7 --sysroot=/opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi -pipe --sysroot=/opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi -O2 -DLINUX=1 -DLINUX=1 -DLINUX=1 -DLINUX=1 -DLINUX=1 -DLINUX=1 -std=gnu++11 -Wall -W -dM -E -o moc_predefs.h /opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi/usr/lib/mkspecs/features/data/dummy.cpp
/opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/x86_64-pokysdk-linux/usr/bin/moc -DQT_NO_DEBUG -DQT_QUICK_LIB -DQT_GUI_LIB -DQT_QML_LIB -DQT_REMOTEOBJECTS_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB --include /home/linux/imx6ull_dev/ubuntu_sys/ubuntu_rootfs/systemui/moc_predefs.h -I/opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi/usr/lib/mkspecs/linux-oe-g++ -I/home/linux/imx6ull_dev/ubuntu_sys/ubuntu_rootfs/systemui -I/home/linux/imx6ull_dev/ubuntu_sys/ubuntu_rootfs/server -I/opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi/usr/include/QtQuick -I/opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi/usr/include/QtGui -I/opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi/usr/include/QtQml -I/opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi/usr/include/QtRemoteObjects -I/opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi/usr/include/QtNetwork -I/opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi/usr/include/QtCore -I/opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi/usr/include/c++/5.3.0 -I/opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi/usr/include/c++/5.3.0/arm-poky-linux-gnueabi -I/opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi/usr/include/c++/5.3.0/backward -I/opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/x86_64-pokysdk-linux/usr/lib/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/5.3.0/include -I/opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/x86_64-pokysdk-linux/usr/lib/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/5.3.0/include-fixed -I/opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi/usr/include rep_systemuicommonapi_source.h -o moc_rep_systemuicommonapi_source.cpp -I /opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi/usr/include -I /opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi/usr/include/QtRemoteObjects -I /opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi/usr/include -I /opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi/usr/include/QtRemoteObjects
Warning: Failed to resolve include "/home/linux/imx6ull_dev/ubuntu_sys/ubuntu_rootfs/systemui/moc_predefs.h" for moc file rep_systemuicommonapi_source.h
/opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/x86_64-pokysdk-linux/usr/bin/moc -DQT_NO_DEBUG -DQT_QUICK_LIB -DQT_GUI_LIB -DQT_QML_LIB -DQT_REMOTEOBJECTS_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB --include /home/linux/imx6ull_dev/ubuntu_sys/ubuntu_rootfs/systemui/moc_predefs.h -I/opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi/usr/lib/mkspecs/linux-oe-g++ -I/home/linux/imx6ull_dev/ubuntu_sys/ubuntu_rootfs/systemui -I/home/linux/imx6ull_dev/ubuntu_sys/ubuntu_rootfs/server -I/opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi/usr/include/QtQuick -I/opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi/usr/include/QtGui -I/opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi/usr/include/QtQml -I/opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi/usr/include/QtRemoteObjects -I/opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi/usr/include/QtNetwork -I/opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi/usr/include/QtCore -I/opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi/usr/include/c++/5.3.0 -I/opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi/usr/include/c++/5.3.0/arm-poky-linux-gnueabi -I/opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi/usr/include/c++/5.3.0/backward -I/opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/x86_64-pokysdk-linux/usr/lib/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/5.3.0/include -I/opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/x86_64-pokysdk-linux/usr/lib/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/5.3.0/include-fixed -I/opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi/usr/include apklistmodel.h -o moc_apklistmodel.cpp
/opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/x86_64-pokysdk-linux/usr/bin/moc -DQT_NO_DEBUG -DQT_QUICK_LIB -DQT_GUI_LIB -DQT_QML_LIB -DQT_REMOTEOBJECTS_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB --include /home/linux/imx6ull_dev/ubuntu_sys/ubuntu_rootfs/systemui/moc_predefs.h -I/opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi/usr/lib/mkspecs/linux-oe-g++ -I/home/linux/imx6ull_dev/ubuntu_sys/ubuntu_rootfs/systemui -I/home/linux/imx6ull_dev/ubuntu_sys/ubuntu_rootfs/server -I/opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi/usr/include/QtQuick -I/opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi/usr/include/QtGui -I/opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi/usr/include/QtQml -I/opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi/usr/include/QtRemoteObjects -I/opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi/usr/include/QtNetwork -I/opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi/usr/include/QtCore -I/opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi/usr/include/c++/5.3.0 -I/opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi/usr/include/c++/5.3.0/arm-poky-linux-gnueabi -I/opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi/usr/include/c++/5.3.0/backward -I/opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/x86_64-pokysdk-linux/usr/lib/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/5.3.0/include -I/opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/x86_64-pokysdk-linux/usr/lib/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/5.3.0/include-fixed -I/opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi/usr/include launchintent.h -o moc_launchintent.cpp
/opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/x86_64-pokysdk-linux/usr/bin/moc -DQT_NO_DEBUG -DQT_QUICK_LIB -DQT_GUI_LIB -DQT_QML_LIB -DQT_REMOTEOBJECTS_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB --include /home/linux/imx6ull_dev/ubuntu_sys/ubuntu_rootfs/systemui/moc_predefs.h -I/opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi/usr/lib/mkspecs/linux-oe-g++ -I/home/linux/imx6ull_dev/ubuntu_sys/ubuntu_rootfs/systemui -I/home/linux/imx6ull_dev/ubuntu_sys/ubuntu_rootfs/server -I/opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi/usr/include/QtQuick -I/opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi/usr/include/QtGui -I/opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi/usr/include/QtQml -I/opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi/usr/include/QtRemoteObjects -I/opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi/usr/include/QtNetwork -I/opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi/usr/include/QtCore -I/opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi/usr/include/c++/5.3.0 -I/opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi/usr/include/c++/5.3.0/arm-poky-linux-gnueabi -I/opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi/usr/include/c++/5.3.0/backward -I/opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/x86_64-pokysdk-linux/usr/lib/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/5.3.0/include -I/opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/x86_64-pokysdk-linux/usr/lib/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/5.3.0/include-fixed -I/opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi/usr/include ../server/systemuicommonapiserver.h -o moc_systemuicommonapiserver.cpp
arm-poky-linux-gnueabi-g++  -march=armv7ve -mfpu=neon  -mfloat-abi=hard -mcpu=cortex-a7 --sysroot=/opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi -c -pipe --sysroot=/opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi -O2 -DLINUX=1 -DLINUX=1 -DLINUX=1 -DLINUX=1 -DLINUX=1 -DLINUX=1 -std=gnu++11 -Wall -W -D_REENTRANT -fPIC -DQT_NO_DEBUG -DQT_QUICK_LIB -DQT_GUI_LIB -DQT_QML_LIB -DQT_REMOTEOBJECTS_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -I. -I../server -I/opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi/usr/include/QtQuick -I/opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi/usr/include/QtGui -I/opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi/usr/include/QtQml -I/opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi/usr/include/QtRemoteObjects -I/opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi/usr/include/QtNetwork -I/opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi/usr/include/QtCore -I. -I../Repcs -I/opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi/usr/lib/mkspecs/linux-oe-g++ -o moc_rep_systemuicommonapi_source.o moc_rep_systemuicommonapi_source.cpp
arm-poky-linux-gnueabi-g++  -march=armv7ve -mfpu=neon  -mfloat-abi=hard -mcpu=cortex-a7 --sysroot=/opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi -c -pipe --sysroot=/opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi -O2 -DLINUX=1 -DLINUX=1 -DLINUX=1 -DLINUX=1 -DLINUX=1 -DLINUX=1 -std=gnu++11 -Wall -W -D_REENTRANT -fPIC -DQT_NO_DEBUG -DQT_QUICK_LIB -DQT_GUI_LIB -DQT_QML_LIB -DQT_REMOTEOBJECTS_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -I. -I../server -I/opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi/usr/include/QtQuick -I/opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi/usr/include/QtGui -I/opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi/usr/include/QtQml -I/opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi/usr/include/QtRemoteObjects -I/opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi/usr/include/QtNetwork -I/opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi/usr/include/QtCore -I. -I../Repcs -I/opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi/usr/lib/mkspecs/linux-oe-g++ -o moc_launchintent.o moc_launchintent.cpp
arm-poky-linux-gnueabi-g++  -march=armv7ve -mfpu=neon  -mfloat-abi=hard -mcpu=cortex-a7 --sysroot=/opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi -c -pipe --sysroot=/opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi -O2 -DLINUX=1 -DLINUX=1 -DLINUX=1 -DLINUX=1 -DLINUX=1 -DLINUX=1 -std=gnu++11 -Wall -W -D_REENTRANT -fPIC -DQT_NO_DEBUG -DQT_QUICK_LIB -DQT_GUI_LIB -DQT_QML_LIB -DQT_REMOTEOBJECTS_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -I. -I../server -I/opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi/usr/include/QtQuick -I/opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi/usr/include/QtGui -I/opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi/usr/include/QtQml -I/opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi/usr/include/QtRemoteObjects -I/opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi/usr/include/QtNetwork -I/opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi/usr/include/QtCore -I. -I../Repcs -I/opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi/usr/lib/mkspecs/linux-oe-g++ -o moc_apklistmodel.o moc_apklistmodel.cpp
arm-poky-linux-gnueabi-g++  -march=armv7ve -mfpu=neon  -mfloat-abi=hard -mcpu=cortex-a7 --sysroot=/opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi -c -pipe --sysroot=/opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi -O2 -DLINUX=1 -DLINUX=1 -DLINUX=1 -DLINUX=1 -DLINUX=1 -DLINUX=1 -std=gnu++11 -Wall -W -D_REENTRANT -fPIC -DQT_NO_DEBUG -DQT_QUICK_LIB -DQT_GUI_LIB -DQT_QML_LIB -DQT_REMOTEOBJECTS_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -I. -I../server -I/opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi/usr/include/QtQuick -I/opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi/usr/include/QtGui -I/opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi/usr/include/QtQml -I/opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi/usr/include/QtRemoteObjects -I/opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi/usr/include/QtNetwork -I/opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi/usr/include/QtCore -I. -I../Repcs -I/opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi/usr/lib/mkspecs/linux-oe-g++ -o moc_systemuicommonapiserver.o moc_systemuicommonapiserver.cpp
arm-poky-linux-gnueabi-g++  -march=armv7ve -mfpu=neon  -mfloat-abi=hard -mcpu=cortex-a7 --sysroot=/opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed --sysroot=/opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi -Wl,-O1 -o systemui apklistmodel.o main.o launchintent.o systemuicommonapiserver.o qrc_qml.o qrc_common.o moc_apklistmodel.o moc_launchintent.o moc_systemuicommonapiserver.o moc_rep_systemuicommonapi_source.o   /opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi/usr/lib/libQt5Quick.so /opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi/usr/lib/libQt5Gui.so /opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi/usr/lib/libQt5Qml.so /opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi/usr/lib/libQt5RemoteObjects.so /opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi/usr/lib/libQt5Network.so /opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi/usr/lib/libQt5Core.so /opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi/usr/lib/libGLESv2.so -lpthread   
arm-poky-linux-gnueabi-strip /home/linux/imx6ull_dev/ubuntu_sys/ubuntu_rootfs/systemui/systemui; cp /home/linux/imx6ull_dev/ubuntu_sys/ubuntu_rootfs/systemui/systemui /home/linux/imx6ull_dev/ubuntu_sys/ubuntu_rootfs/systemui/../ui/;

查看

cpp 复制代码
inux@linux-virtual-machine:~/imx6ull_dev/ubuntu_sys/ubuntu_rootfs/systemui$ ls
apklistmodel.cpp      moc_rep_systemuicommonapi_source.cpp
apklistmodel.h        moc_rep_systemuicommonapi_source.o
apklistmodel.o        moc_systemuicommonapiserver.cpp
BottomApp.qml         moc_systemuicommonapiserver.o
launchintent.cpp      Page1.qml
launchintent.h        Page2.qml
launchintent.o        qml.qrc
main.cpp              qrc_common.cpp
main.o                qrc_common.o
main.qml              qrc_qml.cpp
Makefile              qrc_qml.o
moc_apklistmodel.cpp  rep_systemuicommonapi_source.h
moc_apklistmodel.o    systemui
moc_launchintent.cpp  systemuicommonapiserver.o
moc_launchintent.o    systemui.pro
moc_predefs.h         systemui.qrc

查看执行文件是否正确

接下来我们来执行

发现错误

systemui 依赖的 ARM 架构 libGLESv2.so.2 库缺失,该库是 Qt5 Gui 模块依赖的 OpenGL ES 2.0 底层图形库,开发板 /rootfs 中无此库导致加载失败。

cpp 复制代码
inux@linux-virtual-machine:~/imx6ull_dev/ubuntu_sys/ubuntu_rootfs$ cp /opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi/usr/lib/libGLESv2.so.2 ~/imx6ull_dev/ubuntu_sys/ubuntu_rootfs/usr/lib/

拷贝查看libGLESv2.so.2

修正库文件权限(关键)
cpp 复制代码
chmod 755 ~/imx6ull_dev/ubuntu_sys/ubuntu_rootfs/usr/lib/libGLESv2.so*

再次运行

还有库缺失,继续添加

cpp 复制代码
cp /opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi/usr/lib/libdrm.so.2 ~/imx6ull_dev/ubuntu_sys/ubuntu_rootfs/usr/lib/

查看

修正库文件权限
cpp 复制代码
chmod 755 ~/imx6ull_dev/ubuntu_sys/ubuntu_rootfs/usr/lib/libdrm.so*

运行

又缺东西,没完没了了、、、、、、、、、

继续

cpp 复制代码
cp /opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi/usr/lib/libglapi.so.0 ~/imx6ull_dev/ubuntu_sys/ubuntu_rootfs/usr/lib/
cpp 复制代码
chmod 755 ~/imx6ull_dev/ubuntu_sys/ubuntu_rootfs/usr/lib/libglapi.so*

继续

cpp 复制代码
cp /opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi/usr/lib/plugins/platforms/libqlinuxfb.so ~/imx6ull_dev/ubuntu_sys/ubuntu_rootfs/usr/lib/qt5/plugins/platforms/
cpp 复制代码
chmod 755 ~/imx6ull_dev/ubuntu_sys/ubuntu_rootfs/usr/lib/qt5/plugins/platforms/libqlinuxfb.so

???继续

cpp 复制代码
# 编辑用户级环境变量文件
vim ~/.bashrc
# 在文件末尾添加以下内容
export QT_QPA_PLATFORM_PLUGIN_PATH=/opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi/usr/lib/plugins/platforms/
# 使配置立即生效
source ~/.bashrc

三、从新来过qmake阶段

禁用xcb(PC 端 Linux(Ubuntu)),,用linuxfb(I.MX6U 嵌入式系统)

清除

cpp 复制代码
rm -rf Makefile .qmake.stash *.o moc_* ui_* systemui

qmake制作Makefile

cpp 复制代码
qmake systemui.pro \
QT_QPA_DEFAULT_PLATFORM=linuxfb \
CONFIG-=xcb \
CONFIG+=release \
LIBS+=-L/opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi/usr/lib/ \
INCLUDEPATH+=/opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi/usr/include/

# 3. 重新执行qmake(加更严格的xcb禁用参数)
qmake systemui.pro \
QT_QPA_DEFAULT_PLATFORM=linuxfb \
CONFIG-=xcb \
CONFIG-=xcb-xlib \
CONFIG+=release \
QT_PLUGIN_PATH=/opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi/usr/lib/plugins/ \
LIBS+=-L/opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi/usr/lib/ \
INCLUDEPATH+=/opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi/usr/include/

用第二个,因为我添加的qt库1还在会先扫描,执行第二个命令

检查

cpp 复制代码
arm-poky-linux-gnueabi-readelf -d ./systemui | grep xcb

为空就正确了

make -j8编译

再增加库

cpp 复制代码
cp /opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi/usr/lib/libts.so.0 ~/imx6ull_dev/ubuntu_sys/ubuntu_rootfs/usr/lib/
cpp 复制代码
chmod 755 ~/imx6ull_dev/ubuntu_sys/ubuntu_rootfs/usr/lib/libts.so.0

继续

cpp 复制代码
cp /opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi/usr/lib/qt5_qml_modules.tar.gz ./
cpp 复制代码
tar -zxvf qt5_qml_modules.tar.gz 

继续

cpp 复制代码
cp /opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi/usr/lib/libQt5QuickTemplates2.so.5 ./
cpp 复制代码
chmod 755 ~/imx6ull_dev/ubuntu_sys/ubuntu_rootfs/usr/lib/libQt5QuickTemplates2.so.5

继续

cpp 复制代码
cp /opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi/usr/lib/qt5_quick_controls_libs.tar.gz ./

执行

cpp 复制代码
root@localhost:/opt/ui# \
LD_LIBRARY_PATH=/usr/lib:$LD_LIBRARY_PATH \
QT_DEBUG_PLUGINS=1 \
QT_PLUGIN_PATH=/usr/lib/qt5/plugins/ \
QT_QPA_PLATFORM=linuxfb \
QT_QPA_PLATFORM_PLUGIN_PATH=/usr/lib/qt5/plugins/platforms/ \
QML2_IMPORT_PATH=/usr/lib/qt5/qml/ \
QT_FONT_DIR=/usr/lib/fonts/ \
./systemui

四、好了到这里qt的核心模块就好了

新问题(非致命,但影响界面显示):

  1. 字体缺失 :Qt 找不到字体目录 /usr/lib/fonts,导致文字无法渲染;
  2. 图片解码失败 :缺失图片格式插件(如 jpg/png),导致 ipad.jpg 无法显示;
  3. 配置文件读取失败apk1.cfg/apk2.cfg/apk3.cfg 路径错误(localhost.localdomain 是无效域名)。

1、解决字体缺失问题

2、解决图片解码失败

cpp 复制代码
cp /opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi/usr/lib/plugins/qt5_imageformats.tar.gz ./


tar -zxvf qt5_imageformats.tar.gz 

3、解决配置文件读取失败

cpp 复制代码
sudo mkdir -p /opt/ui/src/localhost.localdomain/
cpp 复制代码
 mkdir -p ~/imx6ull_dev/ubuntu_sys/ubuntu_rootfs/opt/ui/src/localhost.localdomain/
 cp /home/linux/imx6ull_dev/ubuntu_sys/ubuntu_rootfs/opt/ui/src/ATK-IMX6U/apk1.cfg ~/imx6ull_dev/ubuntu_sys/ubuntu_rootfs/opt/ui/src/localhost.localdomain/


# 查找 apk2.cfg
linux@linux-virtual-machine:~$ find /home/linux/imx6ull_dev/ubuntu_sys/ubuntu_rootfs/opt/ui/src/ATK-IMX6U/ -name "apk2.cfg" 2>/dev/null
# 拷贝(若查到则执行)
linux@linux-virtual-machine:~$ cp /home/linux/imx6ull_dev/ubuntu_sys/ubuntu_rootfs/opt/ui/src/ATK-IMX6U/apk2.cfg ~/imx6ull_dev/ubuntu_sys/ubuntu_rootfs/opt/ui/src/localhost.localdomain/

# 查找 apk3.cfg
linux@linux-virtual-machine:~$ find /home/linux/imx6ull_dev/ubuntu_sys/ubuntu_rootfs/opt/ui/src/ATK-IMX6U/ -name "apk3.cfg" 2>/dev/null
# 拷贝(若查到则执行)
linux@linux-virtual-machine:~$ cp /home/linux/imx6ull_dev/ubuntu_sys/ubuntu_rootfs/opt/ui/src/ATK-IMX6U/apk3.cfg ~/imx6ull_dev/ubuntu_sys/ubuntu_rootfs/opt/ui/src/localhost.localdomain/
cpp 复制代码
# 1. 在rootfs中创建imageformats目录(若不存在)
linux@linux-virtual-machine:~$ mkdir -p ~/imx6ull_dev/ubuntu_sys/ubuntu_rootfs/usr/lib/qt5/plugins/imageformats/

# 2. 拷贝libqjpeg.so到该目录
linux@linux-virtual-machine:~$ cp /opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi/usr/lib/plugins/imageformats/libqjpeg.so ~/imx6ull_dev/ubuntu_sys/ubuntu_rootfs/usr/lib/qt5/plugins/imageformats/

# 3. 修正权限(确保开发板可访问)
linux@linux-virtual-machine:~$ chmod 755 ~/imx6ull_dev/ubuntu_sys/ubuntu_rootfs/usr/lib/qt5/plugins/imageformats/libqjpeg.so

root@localhost:/opt/ui/src/ATK-IMX6U# cat apk1.cfg

appicons/camera.png 相机 camera

appicons/music.png 音乐 music

appicons/photoview.png 照片 photoview

appicons/player.png 视频 player

appicons/location.png 位置 location

appicons/settings.png 设置 settings

appicons/sensor.png 传感器 sensor

appicons/beep.png 蜂鸣器 beep

appicons/pcba.png 测试 pcba

appicons/qttest.png app测试 qttest

appicons/qttest.png app测试 qttest

cpp 复制代码
# 追加配置行:图标路径 显示名称 App名称(需和你编译的App名一致)
root@localhost:/opt/ui/src/ATK-IMX6U# echo "appicons/qttest.png app测试 qttest" >> apk1.cfg
cpp 复制代码
sed -i '$d' apk1.cfg

这次先到这里了

相关推荐
用户805533698034 天前
不止三件套:QObject 属性系统全关键字与运行时反射!
c++·qt
xcyxiner4 天前
DicomViewer (vcpkg Windows和ubuntu编译)7
qt
Quz9 天前
QML Hello World 入门示例
qt
xcyxiner12 天前
DicomViewer (dcmtk读取dcm文件)5
qt
xcyxiner12 天前
DicomViewer (后台线程处理文件)4
qt
xcyxiner13 天前
DicomViewer (添加模型类)3
qt
xcyxiner13 天前
DicomViewer (目录调整) 2
qt
xcyxiner13 天前
dcmtk vtk vtk-dicom(gdcm) 编译(debug) v2
qt
桥田智能15 天前
桥田智能 QT-650S:面向白车身焊装的 800kg 重载快换解决方案
开发语言·qt·系统架构
森G15 天前
75、服务器源码解析---------云视频服务项目
linux·服务器·网络·c++·qt