最近由于项目的需要,需要在aarch64 Ubuntu16.04中安装QT5,系统自带了一个qt5,但项目要求必须是qt5.12的版本并且需要包含opengl和eglfs的库,所以只能重新对移植QT5.12,下面把移植过程记录下。
-
下载QT5源码
下载地址:https://download.qt.io/archive/qt/
找到自己需要的版本进行下载。
图中标出来的就是源码下载链接。随便下载哪一个都行。下载后放入ubuntu(我用的Ubuntu 16.04)系统中进行解压。
-
解压后进入源码路径。创建一个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中看到。
- 修改编译工具链
修改文件:qtbase/mkspecs/linux-aarch64-gnu-g++/qmake.conf。这个需要根据自己目标机器的cpu架构进行修改。我用的是arm64的cpu,所以是linux-aarch64-gnu-g++/qmake.conf这个文件。其实这里具体用那个文件下的qmake.conf是和配置中的-xplatform参数对应的。
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++
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
这里可以修改成交叉编译工具链的绝对路径。
- 添加QT支持OpenGL es2和eglfs库的路劲和头文件。
MAKEFILE_GENERATOR = UNIX
CONFIG += incremental
QMAKE_INCREMENTAL_STYLE = sublib
include(../common/linux.conf)
include(../common/gcc-base-unix.conf)
include(../common/g++-unix.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++
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)
- 确定文件系统中包含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 "挂载路径"进去后来为挂载的文件系统安装程序。
- 执行编译
经过上面的修改后执行下面命令执行配置和编译
./autoconfig.sh
sudo make install
如果配置过程中出错,需要先删除config.log和config.cache在重新执行autoconfig.sh进行配置。
配置阶段无误的话下面这几项会被选择
openGL ES系列…………yes
EGL…………………………yes
EGLFS……………………yes
EGLFS Mali………………yes
- 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)QMAKE_INCDIR_OPENGL[_ES2]配置错误问题
出现上面问题的时候可以自己检查一下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)
} 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;
} 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目录下,然后根据目标主机的符号链接方式创建响应的符号链接。然后头文件的位置还是采用目标文件系统中的头文件,所有才有了上面哪样配置的情况。下面是我在编译主机上创建的文件,文件来源都来自目标主机的同一个目录下,这个很重要必须目录相同。不然又提示库的连接位置不对。
你以为这样就可以了吗。实际上如果你不删除sysroot 属性指定的哪个文件系统中相同目录下的库文件,在编译的时候一样还是优先找sysroot中指定文件系统的库。
(4)eglfs插件无法显示问题。
本想利用上面的方法编译已经通过了,各种库也能找到,程序也应该可以运行起来了吧,利用QT里面自带的测试程序编译个cube的程序测试一下。结果傻了提示一个0x3003的错误,网上查了一下说是什么显示bpp不匹配的问题,发现没啥用,并且执行echo 16 > /sys/class/graphics/fb0/bits_per_pixel后屏幕就黑屏了。因为刚开始的时候我并没有在配置中添加-no-linuxfb参数,所以linuxfb应该是可以显示的,我就试了一下执行程序的时候改成-platform linuxfb参数,结果依然无法正常显示提示如下:
后来用自己之前编译的一个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 <X11/Xlib.h>
#include <X11/Xutil.h>
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功能也正常
展示一下显示效果:
结束语:
经历了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
最近由于项目的需要,需要在aarch64 Ubuntu16.04中安装QT5,本来系统中自带了一个qt5,奈何项目要求必须是qt5.12的版本并且需要包含opengl和eglfs的库,所以只能重新移植QT5.12到开发板中,下面把移植过程记录下。下载QT5源码下载地址:https://download.qt.io/archive/qt/找到自己需要的版本进行下载。图中标出来的就是源码下载链接。随便下载哪一个都行。下载后放入ubuntu(我用的Ubuntu 16.04)系统中进行解压。解压
meta-qt5-rpi-eglfs支持与RPi / RPi2上的eglfs一起使用qt5。 该层是非官方的。
该层取决于:
URI:git://github.com/meta-qt5/meta-qt5.git分支:主修订版:HEAD
URI:git://github.com/openembedded/meta-oe.git分支:fido版本:HEAD
如果要使用opencv取决于meta-oe。 否则,您可以在此层中屏蔽opencv,如下所示:
在local.conf中
BBMASK = "meta-qt5-rpi-eglfs/recipes-support/opencv"
如果使用userland.bb进行位烘焙失败,是否可以尝试使用vc-graphics-hardfp代替userland,如下所示:
在local.conf中
PREFERRED_PROVIDER_virt
Qt5使用openGL初体验Qt5使用openGL初体验下载Qt5搭建Qt的opengl基本框架源码部分gldemo.h头文件下面是gldemo.cpp源码文件main函数主文件
Qt5使用openGL初体验
最近在这里一个魔方项目,用到了opengl的相关部分,好久也没有玩这个东东,所以还是写下这个过程,作为初学者还是要多动手才行。首先看一看运行的效果,这里绘画了一个三维坐标系,由x、y、z三个...
1、修改配置文件:qt-everywhere-opensource-src-5.3.2/qtbase/mkspecs/linux-arm-gnueabi-g++/qmake.conf#
# qmake configuration for building with arm-linux-gnueabi-g++
#MAKEFILE_GENERATOR = UNIX
CONFIG
含泪研究两周,终于实现了在
RK3399+
ubuntu虚拟机的
交叉编译,并带
opengl es 和
eglfs模块,最终在板子上跑起来
交叉编译后的
qt3d demo,亲测gpu使用正常。
1.准备虚拟机及必备软件和库的
安装
2.
开发板挂载虚拟机,虚拟机共享主机文件夹
3.虚拟机
安装交叉编译链
4.下载
qt5.12.0源码、配置、及编译
5.编译好的
qt库拷贝到
开发板、
开发板环境变量配置
6.运行编译好的
qt程序
7.gpu使用率查看
这次一定要更新,不更新下个月胖三斤!
最近项目上使用RK3568进行软件开发,在编译QT5.12.8 eglfs版本时,报fbdev_window.h无法找到,按照网友的解决方案:
方案一、创建一个空的fbdev_window.h,结果报fbdev_window *没有定义;
方案二、创建一个软链接,将fbdev_window.h软链接到egl.h,结果如方案一所示。
经查阅官方的资料和国外的结果方案,fbdev_window.h文件如下
* This confidential and proprietary softwa
-prefix /home/briskr/
qt_sdk \
-extprefix /home/briskr/
qt_sdk/extprefix \
-hostprefix /home/briskr/
qt_sdk/hostprefix \
-device linux-rasp-pi3-g++ \
-device-option CROSS_COMPILE=/usr/bin/arm-linux-gnueabihf- \
解决arm32环境下QT界面设置为透明却黑屏的问题问题描述解决方法其他
在arm32环境下,使用Q5.9以上的QT时,不管如何设置界面的透明属性(在样式表里设置背景颜色为透明亦或者是直接设置界面的透明属性为true),都无法使得界面透明,从而显示QT app之外的画面;而本来应该透明的部部位全部变成黑色。
在网上搜索了一圈,各种方法绕来绕去都没有解决问题。
因为其他问题在看QT源码的时候,发现QT可以设置显示画面绘制的格式(RGB565、XRGB8888和ARGB8888等),而透明属性
本次
交叉编译是树莓派学习::
qt5交叉编译(armv8 64位).的升级版,这次编译带
opengl Es2的
qt,原因是为了可以在树莓派上运行
QtQuick2的程序。
结果:编译倒是编译出来了,但是程序在目标板上跑不了,目测原因是该64位系统不支持
opengl(或者说驱动没弄对)。可以利用xcb运行,只是比较慢,因为没...
按照网上大佬的教程配置,eglfs-bgm eglfs-device 这两个必须yes的选项总是no,反复重装都不能解决。最终参考了一些教程,修改了一些地方终于是yes了
本文主要都是参照其他的教程,介绍了我成功安装的步骤和条件,主要是一些库的补充和一些步骤的舍去。省去了一些详细操作。第一次写这个可能不太清楚,可以看下面参考
参考:https://zhuanlan.zhihu.com/p/138021025
https://blog.csdn.net/dieju8330/article/details
什么是OpenGL ES?
OpenGL(全写Open Graphics Library)是指定义了一个跨编程语言、跨平台的编程接口规格的专业的图形程序接口。它用于三维图像(二维的亦可),是一个功能强大,调用方便的底层图形库。
OpenGL在不同的平台上有不同的实现,但是它定义好了专业的程序接口,不同的平台都是遵照该接口来进行实现的,思想完全相同,方法名也是一致的,所以使用时也基本一致,只需要根