gpt4 book ai didi

c++ - 为 Raspberry PI 交叉编译 QT static 时只有 eglfs

转载 作者:行者123 更新时间:2023-11-30 05:04:04 29 4
gpt4 key购买 nike

我已经使用 Raspberry PI 交叉编译了 QT 静态

./configure -opengl es2 -opensource -confirm-license -release -static \
-prefix /usr/local/qt5static -hostprefix ~/raspi/qt5 -extprefix ~/raspi/qt5static \
-device linux-rasp-pi-novc-g++ \
-device-option CROSS_COMPILE=arm-raspbian-linux-gnueabihf- \
-optimized-qmake -reduce-exports \
-sysroot ~/raspi/sysroot \
-make libs -make tools -no-use-gold-linker -v

'novc' 设备与 linux-rasp-pi-g++ 基本相同,但没有来自/opt/vc 的包含或库。当我运行该程序时,它以全屏模式启动(因为 eglfs),并且当用 export QT_DEBUG_PLUGINS=1 探测时产生*

QFactoryLoader::QFactoryLoader() ignoring "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3" since plugins are disabled in static builds qt.qpa.plugin: Could not find the Qt platform plugin "android" in "" This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

Available platform plugins are: eglfs, eglfs.

factory loader失败还好,但是为什么只有eglf,哪里有两个?如何确保 xcb 是一个选项并且它是默认选项?

*我使用 myapp -platform android 因为我知道 Android 不在那里。来自 sudo apt install qt 的动态链接 QT 显示

Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, xcb.

我想从我的静态编译中得到它。这是我的 QPA 后端(我确实看到了 X11 的 eglfs,也许这就是我必须触发的...)

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 ...................... yes
EGLFS GBM ............................ no
EGLFS VSP2 ........................... no
EGLFS Mali ........................... no
EGLFS Raspberry Pi ................... no
EGL on X11 ........................... yes
LinuxFB ................................ yes
VNC .................................... yes
Mir client ............................. no
X11:
Using system-provided XCB libraries .. no
EGL on X11 ........................... yes
Xinput2 .............................. no
XCB XKB .............................. yes
XLib ................................. yes
XCB render ........................... yes
XCB GLX .............................. yes
XCB Xlib ............................. yes
Using system-provided xkbcommon ...... no
Native painting (experimental) ....... no

我的 hello_plugin_import 有这个:

// This file is autogenerated by qmake. It imports static plugin classes for
// static plugins specified using QTPLUGIN and QT_PLUGIN_CLASS.<plugin> variables.
#include <QtPlugin>
Q_IMPORT_PLUGIN(QEglFSIntegrationPlugin)
Q_IMPORT_PLUGIN(QXcbEglIntegrationPlugin)
Q_IMPORT_PLUGIN(QXcbGlxIntegrationPlugin)
Q_IMPORT_PLUGIN(QGifPlugin)
Q_IMPORT_PLUGIN(QICNSPlugin)
Q_IMPORT_PLUGIN(QICOPlugin)
Q_IMPORT_PLUGIN(QJpegPlugin)
Q_IMPORT_PLUGIN(QTgaPlugin)
Q_IMPORT_PLUGIN(QTiffPlugin)
Q_IMPORT_PLUGIN(QWbmpPlugin)
Q_IMPORT_PLUGIN(QWebpPlugin)
Q_IMPORT_PLUGIN(QEglFSEmulatorIntegrationPlugin)
Q_IMPORT_PLUGIN(QEglFSKmsEglDeviceIntegrationPlugin)
Q_IMPORT_PLUGIN(QEglFSX11IntegrationPlugin)
Q_IMPORT_PLUGIN(QConnmanEnginePlugin)
Q_IMPORT_PLUGIN(QGenericEnginePlugin)
Q_IMPORT_PLUGIN(QNetworkManagerEnginePlugin)

更新。我注意到我可以将一堆 libxcb 软件包安装到我的 sysroot 中。我想如果我这样做,我可以让 xcb 显示为平台选项(甚至是默认平台选项??)。但这会扰乱我的静态编译吗?我的客户是否也需要安装所有这些库,或者 qmake 会做正确的事情吗?

libglu1-mesa-dev is already the newest version (9.0.0-2.1).
libx11-xcb-dev is already the newest version (2:1.6.4-3).
libxcb-dri2-0-dev is already the newest version (1.12-1).
libxcb-dri2-0-dev set to manually installed.
libxcb-dri3-dev is already the newest version (1.12-1).
libxcb-dri3-dev set to manually installed.
libxcb-glx0-dev is already the newest version (1.12-1).
libxcb-present-dev is already the newest version (1.12-1).
libxcb-present-dev set to manually installed.
libxcb-randr0-dev is already the newest version (1.12-1).
libxcb-randr0-dev set to manually installed.
libxcb-render0-dev is already the newest version (1.12-1).
libxcb-render0-dev set to manually installed.
libxcb-shape0-dev is already the newest version (1.12-1).
libxcb-shape0-dev set to manually installed.
libxcb-sync-dev is already the newest version (1.12-1).
libxcb-sync-dev set to manually installed.
libxcb-xfixes0-dev is already the newest version (1.12-1).
libxcb-xfixes0-dev set to manually installed.
libxcb1-dev is already the newest version (1.12-1).
libxi-dev is already the newest version (2:1.7.9-1).
libxrender-dev is already the newest version (1:0.9.10-1).
The following additional packages will be installed:
libxcb-composite0 libxcb-cursor0 libxcb-damage0 libxcb-dpms0 libxcb-ewmh2 libxcb-record0 libxcb-res0 libxcb-screensaver0 libxcb-xf86dri0 libxcb-xrm0 libxcb-xtest0
libxcb-xv0 libxcb-xvmc0
The following NEW packages will be installed:
libxcb-composite0 libxcb-composite0-dev libxcb-cursor-dev libxcb-cursor0 libxcb-damage0 libxcb-damage0-dev libxcb-dpms0 libxcb-dpms0-dev libxcb-ewmh-dev libxcb-ewmh2
libxcb-icccm4-dev libxcb-image0-dev libxcb-keysyms1-dev libxcb-record0 libxcb-record0-dev libxcb-render-util0-dev libxcb-res0 libxcb-res0-dev libxcb-screensaver0
libxcb-screensaver0-dev libxcb-shm0-dev libxcb-util0-dev libxcb-xf86dri0 libxcb-xf86dri0-dev libxcb-xinerama0-dev libxcb-xkb-dev libxcb-xrm-dev libxcb-xrm0 libxcb-xtest0
libxcb-xtest0-dev libxcb-xv0 libxcb-xv0-dev libxcb-xvmc0 libxcb-xvmc0-dev

最佳答案

我相信,当您使用 -static 配置 Qt 时,您正在将平台插件烘焙到构建中,您以后将无法在插件之间切换。我不确定这一点,但我一直沿着那条路走下去,无法让 qpa 切换工作,只列出了一个平台插件。如果有方法,我很想听听!

如果我在这方面是正确的,那么要使用 xcb 而不是 eglfs,您需要使用 configure 的第一行重新配置 Qt,例如:

./configure -no-eglfs -qpa xcb -qt-xcb -opensource -confirm-license -release -static \

祝你好运

关于c++ - 为 Raspberry PI 交叉编译 QT static 时只有 eglfs,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49109005/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com