QT5+OpenGL es2 + eglfs交叉编译安装(RK3399)

最近由于项目的需要,需要在aarch64 Ubuntu16.04中安装QT5,系统自带了一个qt5,但项目要求必须是qt5.12的版本并且需要包含opengl和eglfs的库,所以只能重新对移植QT5.12,下面把移植过程记录下。

  1. 下载QT5源码

下载地址:https://download.qt.io/archive/qt/
找到自己需要的版本进行下载。
QT5+OpenGL es2 + eglfs交叉编译安装(RK3399)_第1张图片
图中标出来的就是源码下载链接。随便下载哪一个都行。下载后放入ubuntu(我用的Ubuntu 16.04)系统中进行解压。

  1. 解压后进入源码路径。创建一个autoconfig.sh。写入下面内容
#!/bin/sh
./configure \
-sysroot /home/xxxx/project/target  \
-extprefix /opt/qt5.12.11-aarch64 \
-confirm-license \
-opensource \
-release \
-make libs \
-xplatform linux-aarch64-gnu-g++ \
-pch \
-qt-libjpeg \
-qt-libpng \
-qt-zlib \
-no-sse2 \
-no-openssl \
-no-cups \
-no-glib \
-no-dbus \
-qt-xcb \
-no-separate-debug-info \
-opengl es2 \
-egl \
-eglfs \
-qpa eglfs \
-no-linuxfb \
-recheck-all

这里面有两个参数需要注意下。
-sysroot 指定根文件系统位置。交叉编译时指定目标文件系统的挂载路径。并且QT的交叉编译过程会在这个参数指定文件系统下查找所依赖的库和包含的头文件。
-prefix 指定编译完成后make install时的安装位置,如果系统中指定了sysroot参数,那么安装位置为sysroot+prefix。利用默认的安装位置时可以不用指定prefix参数。
-extprefix 这个参数和prefix 的作用差不多,只不多extprefix 指定的安装路径位置不添加sysroot指定的路径,例如:-extprefix /opt/qt5.12.11-aach64 那么make install后安装位置为编译主机的/opt/qt5.12.11-aach64目录中。
注:make install的具体安装位置可以在配置命令执行完成的log中看到。
QT5+OpenGL es2 + eglfs交叉编译安装(RK3399)_第2张图片

  1. 修改编译工具链

修改文件:qtbase/mkspecs/linux-aarch64-gnu-g++/qmake.conf。这个需要根据自己目标机器的cpu架构进行修改。我用的是arm64的cpu,所以是linux-aarch64-gnu-g++/qmake.conf这个文件。其实这里具体用那个文件下的qmake.conf是和配置中的-xplatform参数对应的。

# modifications to g++.conf
QMAKE_CC                = aarch64-linux-gnu-gcc
QMAKE_CXX               = aarch64-linux-gnu-g++
QMAKE_LINK              = aarch64-linux-gnu-g++
QMAKE_LINK_SHLIB        = aarch64-linux-gnu-g++

# modifications to linux.conf
QMAKE_AR                = aarch64-linux-gnu-ar cqs
QMAKE_OBJCOPY           = aarch64-linux-gnu-objcopy
QMAKE_NM                = aarch64-linux-gnu-nm -P
QMAKE_STRIP             = aarch64-linux-gnu-strip

这里可以修改成交叉编译工具链的绝对路径。

  1. 添加QT支持OpenGL es2和eglfs库的路劲和头文件。
#
# qmake configuration for building with aarch64-linux-gnu-g++
#

MAKEFILE_GENERATOR      = UNIX
CONFIG                 += incremental
QMAKE_INCREMENTAL_STYLE = sublib

include(../common/linux.conf)
include(../common/gcc-base-unix.conf)
include(../common/g++-unix.conf)

# modifications to g++.conf
QMAKE_CC                = aarch64-linux-gnu-gcc
QMAKE_CXX               = aarch64-linux-gnu-g++
QMAKE_LINK              = aarch64-linux-gnu-g++
QMAKE_LINK_SHLIB        = aarch64-linux-gnu-g++

# modifications to linux.conf
QMAKE_AR                = aarch64-linux-gnu-ar cqs
QMAKE_OBJCOPY           = aarch64-linux-gnu-objcopy
QMAKE_NM                = aarch64-linux-gnu-nm -P
QMAKE_STRIP             = aarch64-linux-gnu-strip


QMAKE_INCDIR_OPENGL_ES2 = $$[QT_SYSROOT]/usr/include
QMAKE_LIBDIR_OPENGL_ES2 = /usr/lib/aarch64-linux-gnu

QMAKE_INCDIR_EGL        = $$[QT_SYSROOT]/usr/include
QMAKE_LIBDIR_EGL        = /usr/lib/aarch64-linux-gnu


QMAKE_LIBS_EGL         += -lEGL -lGLESv2
QMAKE_LIBS_OPENGL_ES2  += -lGLESv2 -lEGL
load(qt_config)

  1. 确定文件系统中包含opengl的库。可以在文件系统usr目录下找一下libEGL.so libGLESv2.so这两个库
find .| grep "EGL"
find .| grep "GLESv2"

如果没有找到相应的库。可以通过下面命令安装。

sudo apt-get install libgles2-mesa
sudo apt-get install libgles2-mesa-dev

注意上面的命令都是在挂载的目标机文件系统下操作。
安装上面的库时可以利用sudo chroot "挂载路径"进去后来为挂载的文件系统安装程序。

  1. 执行编译
    经过上面的修改后执行下面命令执行配置和编译
./autoconfig.sh
make
sudo make install 

如果配置过程中出错,需要先删除config.log和config.cache在重新执行autoconfig.sh进行配置。
配置阶段无误的话下面这几项会被选择


 openGL ES系列…………yes

EGL…………………………yes

EGLFS……………………yes

EGLFS Mali………………yes

  1. QT部署
    make install 编译好的QT系统会被安装到extprefix指定的目录中。copy打包这个目录并把它放在目标主机中相同的目录结构下,建议用tar的方式压缩,防止丢失符号链接。如果make install安装的目录需要管理员权限访问可以sudo make install。
    配置环境变量
    修改/etc/profile文件添加下面环境变量
export QTDIR=/opt/qt5.12.11-aarch64
export LD_LIBRARY_PATH=$QTDIR/lib:$LD_LIBRARY_PATH
export QT_QPA_PLATFORM_PLUGIN_PATH=$QTDIR/plugins
export QT_QPA_PLATFORM=eglfs

QT_QPA_PLATFORM这个环境变量可以不用指定,如果想用eglfs显示可以在运行QT程序的时候增加参数“-platform eglfs”。
如果想在sudo命令下正确的利用eglfs插件显示还需要在 /etc/environment中添加如下两行。
这里特别提一下export QT_DEBUG_PLUGINS=1这个环境变量,设置后会打印log。通过打印出来的log可以分析程序是在什么地方出错了,如果存在库的依赖不存在也会在log中指出是哪个位置的少什么样的库。个人感觉挺非常有用。

LD_LIBRARY_PATH=/opt/qt5.12.11-aarch64/lib
QT_QPA_PLATFORM_PLUGIN_PATH=/opt/qt5.12.11-aarch64/plugins
  1. 移植过程错误解决
    (1)QMAKE_INCDIR_OPENGL[_ES2]配置错误问题
    QT5+OpenGL es2 + eglfs交叉编译安装(RK3399)_第3张图片
    出现上面问题的时候可以自己检查一下qtbase/mkspecs/linux-aarch64-gnu-g++/qmake.conf中对opengl的哪几项配置是不是有问题,能不能找到libEGL.so libGLESv2.so库和相关的头文件。是在找不到问题在哪可以试着执行rm config.*将配置过程中的临时文件删除掉在执行./autoconfig.sh试试。如果检查好都没啥问题还是报这样的错误,不防备份autoconfig.sh和qmake.conf文件,然后把QT的源码删除了重新解压一份在把autoconfig.sh和qmake.conf放在各自的录下,运行autoconfig.sh在试试。
    注意我的qmake.config中指定的QMAKE_INCDIR_OPENGL_ES2、QMAKE_LIBDIR_OPENGL_ES2、QMAKE_INCDIR_EGL、QMAKE_LIBDIR_EGL不在同一文件系统中,具体原因看"编译生成的libqeglfs.so依赖库位置错误问题"中的介绍。
    (2)EGLFS Mali 不能被选中,提示下面错误:
EGLFS Mali………………no

查找config.log会发现有提示fbdev_window *没有定义错误。网上查到两种解决办法
方案一、创建一个空的fbdev_window.h,结果报fbdev_window *没有定义;
方案二、创建一个软链接,将fbdev_window.h软链接到egl.h,结果如方案一所示。ln -s egl.h fbdev_window.h
试了上面两种方式都没有用,从log中提示的错误可以判断是少一个fbdev_window的类型。而上面哪两种方案其实都实际上没有把这个数据类型定义,所以才会失败。后来查找到下面的帖子,完美解决这个错误。https://blog.csdn.net/lixiaojun216/article/details/121602501。这里非常感谢博主的分享。
创建fbdev_window.h文件存放到目标文件系统的/usr/include/EGL目录下,头文件内容如下

/*
 1. This confidential and proprietary software may be used only as
 2. authorised by a licensing agreement from ARM Limited
 3. (C) COPYRIGHT 2008-2011 ARM Limited
 4. ALL RIGHTS RESERVED
 5. The entire notice above must be reproduced on all authorised
 6. copies and copies may only be made to the extent permitted
 7. by a licensing agreement from ARM Limited.
 */
 
/**
 8. @file fbdev_window.h
 9. @brief A window type for the framebuffer device (used by egl and tests)
 */
 
#ifndef _FBDEV_WINDOW_H_
#define _FBDEV_WINDOW_H_
 
#ifdef __cplusplus
extern "C" {
#endif
 
typedef enum
{
	FBDEV_PIXMAP_DEFAULT = 0,
	FBDEV_PIXMAP_SUPPORTS_UMP = (1<<0),
	FBDEV_PIXMAP_ALPHA_FORMAT_PRE = (1<<1),
	FBDEV_PIXMAP_COLORSPACE_sRGB = (1<<2),
	FBDEV_PIXMAP_EGL_MEMORY = (1<<3)        /* EGL allocates/frees this memory */
} fbdev_pixmap_flags;
 
typedef struct fbdev_window
{
	unsigned short width;
	unsigned short height;
} fbdev_window;
 
typedef struct fbdev_pixmap
{
	unsigned int height;
	unsigned int width;
	unsigned int bytes_per_pixel;
	unsigned char buffer_size;
	unsigned char red_size;
	unsigned char green_size;
	unsigned char blue_size;
	unsigned char alpha_size;
	unsigned char luminance_size;
	fbdev_pixmap_flags flags;
	unsigned short *data;
	unsigned int format; /* extra format information in case rgbal is not enough, especially for YUV formats */
} fbdev_pixmap;
 
#ifdef __cplusplus
}
#endif
 
 
#endif

(3)编译生成的libqeglfs.so依赖库位置错误问题:
利用ldd命令查看/opt/qt5.12.11-aarch64/plugins/platforms/libqeglfs.so会发现这个库所依赖libGLESv2.so的位置不对,位置中包含了编译主机的路径,例如通过上面的方式编译出来的libGLESv2.so位置指向了/home/xxxx/project/target/usr/lib/aarch64-linux-gnu目录。libEGL.so也存在同样的问题。
方法一:在目标文件系统中根据上面的要求在指定的目录下创建响应的符号链接,链接到库的实际位置上去。但是对于强迫症患者,这种方法有点要命。
方法二:这里就要提到QMAKE_INCDIR_OPENGL_ES2、QMAKE_LIBDIR_OPENGL_ES2、QMAKE_INCDIR_EGL、QMAKE_LIBDIR_EGL这几个配置参数的妙用了。他们分别指定了编译openGL时查找libGLESv2.so和libEGL.so库的位置,以及头文件的位置。这里我把这两个库cpoy到编译主机的/usr/lib/aarch64-linux-gnu目录下,然后根据目标主机的符号链接方式创建响应的符号链接。然后头文件的位置还是采用目标文件系统中的头文件,所有才有了上面哪样配置的情况。下面是我在编译主机上创建的文件,文件来源都来自目标主机的同一个目录下,这个很重要必须目录相同。不然又提示库的连接位置不对。
QT5+OpenGL es2 + eglfs交叉编译安装(RK3399)_第4张图片
你以为这样就可以了吗。实际上如果你不删除sysroot 属性指定的哪个文件系统中相同目录下的库文件,在编译的时候一样还是优先找sysroot中指定文件系统的库。
(4)eglfs插件无法显示问题。
本想利用上面的方法编译已经通过了,各种库也能找到,程序也应该可以运行起来了吧,利用QT里面自带的测试程序编译个cube的程序测试一下。结果傻了提示一个0x3003的错误,网上查了一下说是什么显示bpp不匹配的问题,发现没啥用,并且执行echo 16 > /sys/class/graphics/fb0/bits_per_pixel后屏幕就黑屏了。因为刚开始的时候我并没有在配置中添加-no-linuxfb参数,所以linuxfb应该是可以显示的,我就试了一下执行程序的时候改成-platform linuxfb参数,结果依然无法正常显示提示如下:
QT5+OpenGL es2 + eglfs交叉编译安装(RK3399)_第5张图片
后来用自己之前编译的一个framebuffer的程序来试了一下在屏上显示图片,结果和这个错误一样。初步判断这个可能和文件系统有关系,因为我的目标文件系统是ubuntu 16.04桌面用的是xubuntu。这种桌面一般用的都是x11的显示方式,所以没再纠结这个问题。同时也在想上面那个eglfs无法显示的问题是不是也是不支持x11的显示方式在造成的。并且我在网上还查找到有个xcb的插件用的就是x11的显示方式。于是在QT的编译配置中加入-qt-xcb的参数,先确定程序能正常运行起来。
本以为添加了-qt-xcb直接配置编译就能通过,结果配置过程中就提示各种错误。有提示就好,根据提示各种网上搜索,并且config.log中也记录了配置过程出错的log。后来总结了一下,其实这个过程中出错大多是因为缺少头文件和编译依赖的库所致,经过一下修改后可以成功配置和编译
目标文件系统中安装下面依赖库
apt-get install libx11-dev libx11-xcb-dev
apt-get install libxkbcommon-dev libxkbcommon-x11-dev
因为我上面挂载的是一个完整的文件体统,所以通chroot命令进入文件系统后,只要网络正常就可以直接通过命令安装程序。
修改/usr/include/EGL/eglplatform.h文件,

struct gbm_device;
struct gbm_surface;

#if defined(__GBM__)
typedef struct gbm_device * EGLNativeDisplayType;
typedef struct gbm_surface * EGLNativeWindowType;
typedef void * EGLNativePixmapType;
#elif defined(__unix__)
#include 
#include 
typedef Display *EGLNativeDisplayType;
typedef Pixmap EGLNativePixmapType;
typedef Window EGLNativeWindowType;
#endif

typedef EGLNativeWindowType NativeWindowType;
typedef EGLNativePixmapType NativePixmapType;
typedef EGLNativeDisplayType NativeDisplayType;

具体可以参考https://dev.t-firefly.com/thread-13087-1-9.html中的介绍。也谢谢博主奉献。
通过上面的修改后重启编译部署QT并重新编译一下cube应用,放到目标主机中运行./cube -platform xcb,程序可以正常运行,但是用-platform eglfs显示还是依然存在文件。
继续查看log信息,发现EGLFS X11 … no有这么一行,怀疑是不是就是因为这个没有被选中才导致了显示错误。通过对config.log分析最后查找到安装下面两个库可以解决此问题。

apt-get install libxext-dev libxfixes-dev

下面是配置过程中控制台输出的信息,贴出来分享一下,如果又相同的移植过程可以对比一下输出

+ cd qtbase
+ /home/lincor/project/qt-src/qtbase/configure -top-level -sysroot /home/lincor/project/target -extprefix /opt/qt5.12.11-aarch64 -confirm-license -opensource -release -make libs -xplatform linux-aarch64-gnu-g++ -pch -qt-libjpeg -qt-libpng -qt-zlib -no-sse2 -no-openssl -no-cups -no-glib -no-dbus -qt-xcb -no-separate-debug-info -opengl es2 -egl -eglfs -qpa eglfs -no-linuxfb -recheck-all
Creating qmake...
Done.

This is the Qt Open Source Edition.

You have already accepted the terms of the Open Source license.

Running configuration tests...
Checking for gold linker... yes
Checking for machine tuple... yes
Checking for valid makespec... yes
Checking for alloca() in alloca.h... yes
Checking for target architecture... arm64
Checking for host architecture... x86_64
Checking for C++14 support... yes
Checking for C++1z support... no
Checking for C99 support... yes
Checking for C11 support... yes
Checking for new dtags support... yes
Checking for pkg-config... yes
Checking for D-Bus >= 1.2 (host)... yes
Checking for udev... no
Checking for POSIX fallocate()... yes
Checking for precompiled header support... yes
Checking for RDRAND instruction... no
Checking for symbol visibility support... yes
Checking for -Bsymbolic-functions support... no
Checking for STL compatibility... yes
Checking for clock_gettime()... yes
Checking for POSIX monotonic clock... yes
Checking for C++11 <future>... yes
Checking for dlopen()... yes
Checking for eventfd... yes
Checking for futimens()... yes
Checking for getauxval()... yes
Checking for getentropy()... no
Checking for GNU libc... yes
Checking for POSIX iconv... yes
Checking for ICU... no
Checking for inotify... yes
Checking for SysV IPC... yes
Checking for linkat()... yes
Checking for ppoll()... yes
Checking for renameat2()... no
Checking for slog2... no
Checking for statx() in libc... no
Checking for 64 bit atomics... yes
Checking for DoubleConversion... no
Checking for PCRE2... no
Checking for O_CLOEXEC... yes
Checking for C++11 <random>... yes
Checking for working std::atomic for function pointers... yes
Checking for getifaddrs()... yes
Checking for IPv6 ifname... yes
Checking for Linux AF_NETLINK sockets... yes
Checking for xkbcommon >= 0.5.0... yes
Checking for XCB >= 1.9... yes
Checking for OpenGL ES 2.0... yes
Checking for KMS... no
Checking for EGL... yes
Checking for XLib... yes
Checking for EGL on X11... yes
Checking for EGLDevice... yes
Checking for GBM... yes
Checking for Mali EGL... yes
Checking for i.Mx6 EGL... no
Checking for XCB Xlib... yes
Checking for evdev... yes
Checking for FreeType... no
Checking for mtdev... no
Checking for OpenGL ES 3.0... yes
Checking for OpenGL ES 3.1... yes
Checking for OpenGL ES 3.2... yes
Checking for OpenVG... no
Checking for default QPA platform... eglfs
Checking for HarfBuzz... no
Checking for tslib... no
Checking for Vulkan... no
Checking for X11 prefix... /usr
Checking for X11 session management... no
Checking for xkbcommon-x11... yes
Checking for DB2 (IBM)... no
Checking for InterBase... no
Checking for MySQL... no
Checking for OCI (Oracle)... no
Checking for ODBC... no
Checking for PostgreSQL... no
Checking for SQLite (version 2)... no
Checking for TDS (Sybase)... no
Checking for Socket CAN... yes
Checking for Socket CAN FD... yes
Checking for jasper... no
Checking for mng... no
Checking for tiff... no
Checking for webp... no
Checking for Direct3D 12... no
Checking for SDL2... no
Checking for Assimp... no
Checking for Autodesk FBX... no
Checking for Wayland client library... no
Checking for Wayland EGL library... no
Checking for wayland-server... no
Checking for BlueZ... no
Checking for sensorfw... no
Checking for Gypsy... no
Checking for WinRT Geolocation API... no
Checking for ALSA... no
Checking for Vivante GPU... no
Checking for GStreamer 1.0... no
Checking for GStreamer 0.10... no
Checking for Video for Linux... yes
Checking for OpenAL... no
Checking for PulseAudio >= 0.9.10... no
Checking for libresourceqt5... no
Checking for libclang... no
Checking for alsa... no
Checking for embedded... yes
Checking for bison... yes
Checking for flex... yes
Checking for gperf... no
Checking for host pkg-config... /usr/bin/pkg-config
Checking for linker supports -z noexecstack... yes
Checking for x11... yes
Checking for libdrm... no
Checking for poppler-cpp... no
Checking for pulseaudio >= 0.9.10... no
Checking for python2... /usr/bin/python2
Checking for d-bus... no
Checking for fontconfig... no
Checking for glib-2.0 >= 2.32.0... no
Checking for glibc > 2.16... yes
Checking for jsoncpp... no
Checking for khr... yes
Checking for libevent... no
Checking for libvpx... no
Checking for libwebp, libwebpmux and libwebpdemux... no
Checking for libxml2 and libxslt... no
Checking for minizip... no
Checking for system ninja... no
Checking for nss >= 3.26... no
Checking for opus... no
Checking for protobuf... no
Checking for re2... no
Checking for snappy... no
Checking for xcomposite... no
Checking for xcursor... no
Checking for xi... no
Checking for xtst... no
Done running configuration tests.

Configure summary:

Building on: linux-g++ (x86_64, CPU features: mmx sse sse2)
Building for: linux-aarch64-gnu-g++ (arm64, CPU features: neon)
Target compiler: gcc 5.4.0
Configuration: cross_compile use_gold_linker compile_examples enable_new_dtags largefile neon precompile_header shared rpath release c++11 c++14 concurrent reduce_exports stl
Build options:
  Mode ................................... release
  Optimize release build for size ........ no
  Building shared libraries .............. yes
  Using C standard ....................... C11
  Using C++ standard ..................... C++14
  Using ccache ........................... no
  Using gold linker ...................... yes
  Using new DTAGS ........................ yes
  Using precompiled headers .............. yes
  Using LTCG ............................. no
  Target compiler supports:
    NEON ................................. yes
  Build parts ............................ libs
Qt modules and options:
  Qt Concurrent .......................... yes
  Qt D-Bus ............................... no
  Qt D-Bus directly linked to libdbus .... no
  Qt Gui ................................. yes
  Qt Network ............................. yes
  Qt Sql ................................. yes
  Qt Testlib ............................. yes
  Qt Widgets ............................. yes
  Qt Xml ................................. yes
Support enabled for:
  Using pkg-config ....................... yes
  udev ................................... no
  Using system zlib ...................... no
Qt Core:
  DoubleConversion ....................... yes
    Using system DoubleConversion ........ no
  GLib ................................... no
  iconv .................................. yes
  ICU .................................... no
  Tracing backend ........................ <none>
  Logging backends:
    journald ............................. no
    syslog ............................... no
    slog2 ................................ no
  Using system PCRE2 ..................... no
Qt Network:
  getifaddrs() ........................... yes
  IPv6 ifname ............................ yes
  libproxy ............................... no
  Linux AF_NETLINK ....................... yes
  OpenSSL ................................ no
    Qt directly linked to OpenSSL ........ no
  OpenSSL 1.1 ............................ no
  DTLS ................................... no
  SCTP ................................... no
  Use system proxies ..................... yes
Qt Gui:
  Accessibility .......................... yes
  FreeType ............................... yes
    Using system FreeType ................ no
  HarfBuzz ............................... yes
    Using system HarfBuzz ................ no
  Fontconfig ............................. no
  Image formats:
    GIF .................................. yes
    ICO .................................. yes
    JPEG ................................. yes
      Using system libjpeg ............... no
    PNG .................................. yes
      Using system libpng ................ no
  EGL .................................... yes
  OpenVG ................................. no
  OpenGL:
    Desktop OpenGL ....................... no
    OpenGL ES 2.0 ........................ yes
    OpenGL ES 3.0 ........................ yes
    OpenGL ES 3.1 ........................ yes
    OpenGL ES 3.2 ........................ yes
  Vulkan ................................. no
  Session Management ..................... yes
Features used by QPA backends:
  evdev .................................. yes
  libinput ............................... no
  INTEGRITY HID .......................... no
  mtdev .................................. no
  tslib .................................. no
  xkbcommon .............................. yes
  X11 specific:
    XLib ................................. yes
    XCB Xlib ............................. yes
    EGL on X11 ........................... yes
QPA backends:
  DirectFB ............................... no
  EGLFS .................................. yes
  EGLFS details:
    EGLFS OpenWFD ........................ no
    EGLFS i.Mx6 .......................... no
    EGLFS i.Mx6 Wayland .................. no
    EGLFS RCAR ........................... no
    EGLFS EGLDevice ...................... no
    EGLFS GBM ............................ no
    EGLFS VSP2 ........................... no
    EGLFS Mali ........................... yes
    EGLFS Raspberry Pi ................... no
    EGLFS X11 ............................ yes
  LinuxFB ................................ no
  VNC .................................... yes
  Mir client ............................. no
  XCB:
    Using system-provided XCB libraries .. no
    XCB XKB .............................. yes
    XCB XInput ........................... yes
    Native painting (experimental) ....... no
    GL integrations:
      GLX Plugin ......................... no
      EGL-X11 Plugin ..................... yes
Qt Sql:
  SQL item models ........................ yes
Qt Widgets:
  GTK+ ................................... no
  Styles ................................. Fusion Windows
Qt PrintSupport:
  CUPS ................................... no
Qt Sql Drivers:
  DB2 (IBM) .............................. no
  InterBase .............................. no
  MySql .................................. no
  OCI (Oracle) ........................... no
  ODBC ................................... no
  PostgreSQL ............................. no
  SQLite2 ................................ no
  SQLite ................................. yes
    Using system provided SQLite ......... no
  TDS (Sybase) ........................... no
Qt Testlib:
  Tester for item models ................. yes
Qt SerialBus:
  Socket CAN ............................. yes
  Socket CAN FD .......................... yes
Further Image Formats:
  JasPer ................................. no
  MNG .................................... no
  TIFF ................................... yes
    Using system libtiff ................. no
  WEBP ................................... yes
    Using system libwebp ................. no
Qt QML:
  QML network support .................... yes
  QML debugging and profiling support .... yes
  QML sequence object .................... yes
  QML list model ......................... yes
  QML XML http request ................... yes
  QML Locale ............................. yes
  QML delegate model ..................... yes
Qt Quick:
  Direct3D 12 ............................ no
  AnimatedImage item ..................... yes
  Canvas item ............................ yes
  Support for Qt Quick Designer .......... yes
  Flipable item .......................... yes
  GridView item .......................... yes
  ListView item .......................... yes
  TableView item ......................... yes
  Path support ........................... yes
  PathView item .......................... yes
  Positioner items ....................... yes
  Repeater item .......................... yes
  ShaderEffect item ...................... yes
  Sprite item ............................ yes
Qt Scxml:
  ECMAScript data model for QtScxml ...... yes
Qt Gamepad:
  SDL2 ................................... no
Qt 3D:
  Assimp ................................. yes
  System Assimp .......................... no
  Output Qt3D Job traces ................. no
  Output Qt3D GL traces .................. no
  Use SSE2 instructions .................. no
  Use AVX2 instructions .................. no
  Aspects:
    Render aspect ........................ yes
    Input aspect ......................... yes
    Logic aspect ......................... yes
    Animation aspect ..................... yes
    Extras aspect ........................ yes
Qt 3D Renderers:
  OpenGL Renderer ........................ yes
Qt 3D GeometryLoaders:
  Autodesk FBX ........................... no
Qt Wayland Client ........................ no
Qt Wayland Compositor .................... no
Qt Bluetooth:
  BlueZ .................................. no
  BlueZ Low Energy ....................... no
  Linux Crypto API ....................... no
  WinRT Bluetooth API (desktop & UWP) .... no
Qt Sensors:
  sensorfw ............................... no
Qt Quick Controls 2:
  Styles ................................. Default Fusion Imagine Material Universal
Qt Quick Templates 2:
  Hover support .......................... yes
  Multi-touch support .................... yes
Qt Positioning:
  Gypsy GPS Daemon ....................... no
  WinRT Geolocation API .................. no
Qt Location:
  Qt.labs.location experimental QML plugin . yes
  Geoservice plugins:
    OpenStreetMap ........................ yes
    HERE ................................. yes
    Esri ................................. yes
    Mapbox ............................... yes
    MapboxGL ............................. yes
    Itemsoverlay ......................... yes
QtXmlPatterns:
  XML schema support ..................... yes
Qt Multimedia:
  ALSA ................................... no
  GStreamer 1.0 .......................... no
  GStreamer 0.10 ......................... no
  Video for Linux ........................ yes
  OpenAL ................................. no
  PulseAudio ............................. no
  Resource Policy (libresourceqt5) ....... no
  Windows Audio Services ................. no
  DirectShow ............................. no
  Windows Media Foundation ............... no
Qt Tools:
  QDoc ................................... no
Qt WebEngine:
  Embedded build ......................... yes
  Full debug information ................. no
  Pepper Plugins ......................... no
  Printing and PDF ....................... no
  Proprietary Codecs ..................... no
  Spellchecker ........................... yes
  Native Spellchecker .................... no
  WebRTC ................................. no
  Use System Ninja ....................... no
  Geolocation ............................ yes
  WebChannel support ..................... yes
  Use v8 snapshot ........................ yes
  Kerberos Authentication ................ no
  Support qpa-xcb ........................ no
  Building v8 snapshot supported ......... yes
  Use ALSA ............................... no
  Use PulseAudio ......................... no
  Optional system libraries used:
    re2 .................................. no
    icu .................................. no
    libwebp, libwebpmux and libwebpdemux . no
    opus ................................. no
    ffmpeg ............................... no
    libvpx ............................... no
    snappy ............................... no
    glib ................................. no
    zlib ................................. no
    minizip .............................. no
    libevent ............................. no
    jsoncpp .............................. no
    protobuf ............................. no
    libxml2 and libxslt .................. no
    lcms2 ................................ no
    png .................................. no
    JPEG ................................. no
    harfbuzz ............................. no
    freetype ............................. no
  Required system libraries:
    fontconfig ........................... no
    dbus ................................. no
    nss .................................. no
    khr .................................. yes
    glibc ................................ yes
  Required system libraries for qpa-xcb:
    x11 .................................. yes
    libdrm ............................... no
    xcomposite ........................... no
    xcursor .............................. no
    xi ................................... no
    xtst ................................. no

Note: Also available for Linux: linux-clang linux-icc

Note: PKG_CONFIG_LIBDIR automatically set to /home/lincor/project/target/usr/lib/pkgconfig:/home/lincor/project/target/usr/share/pkgconfig:/home/lincor/project/target/usr/lib/aarch64-linux-gnu/pkgconfig

Note: PKG_CONFIG_SYSROOT_DIR automatically set to /home/lincor/project/target

Note: Disabling X11 Accessibility Bridge: D-Bus or AT-SPI is missing.

Note: No wayland-egl support detected. Cross-toolkit compatibility disabled.

WARNING: QDoc will not be compiled, probably because libclang could not be located. This means that you cannot build the Qt documentation.

Either ensure that llvm-config is in your PATH environment variable, or set LLVM_INSTALL_DIR to the location of your llvm installation.
On Linux systems, you may be able to install libclang by installing the libclang-dev or libclang-devel package, depending on your distribution.
On macOS, you can use Homebrew's llvm package.
On Windows, you must set LLVM_INSTALL_DIR to the installation path.

WARNING: gperf is required to build QtWebEngine.

Qt is now configured for building. Just run 'make'.
Once everything is built, you must run 'make install'.
Qt will be installed into '/opt/qt5.12.11-aarch64'.

Prior to reconfiguration, make sure you remove any leftovers from
the previous build.

经过上面的移植后eglfs插件可以正常运行,并且GPU功能也正常
展示一下显示效果:
QT5+OpenGL es2 + eglfs交叉编译安装(RK3399)_第6张图片
结束语:
经历了3周多时间,终于是搞定了QT的移植,整个过程中踩了不少的坑,这里记录下来一是为了后面再遇到此类问题能有个参考,二也是分享一下自己经验,希望后来人在移植过程中少踩点坑。
能读到这里朋友,谢谢你对这片文章的支持。另外文章中大部分内容为手敲,错别字比较多,还望谅解。

QT5+OpenGL es2 + eglfs交叉编译安装(续)

eglplatform.h和fbdev_window.h下载下载:
https://download.csdn.net/download/xuesong10210/76481431
交叉编译产物下载地址:
https://download.csdn.net/download/xuesong10210/76495076

参考:
https://blog.csdn.net/pengjiaqi1028/article/details/111476742
https://blog.csdn.net/lixiaojun216/article/details/121602501
https://blog.csdn.net/yuangc/article/details/118021354
https://blog.csdn.net/dieju8330/article/details/86743919
https://dev.t-firefly.com/thread-13087-1-9.html

你可能感兴趣的:(经验分享,qt,开发语言,ubuntu)