首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >只在Raspberry PI交叉编译QT静态时使用eglfs

只在Raspberry PI交叉编译QT静态时使用eglfs
EN

Stack Overflow用户
提问于 2018-03-05 11:03:17
回答 1查看 1.8K关注 0票数 1

我为Raspberry PI提供了交叉编译的QT静态

代码语言:javascript
复制
./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 g++本质上是相同的,但是没有包含/opt/vc中的libs。当我运行这个程序时,它会在全屏启动(因为有eglfs),并且当被探测到export QT_DEBUG_PLUGINS=1的结果时*

QFactoryLoader::QFactoryLoader()忽略"org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3“,因为静态构建中禁用了插件qt.qpa.plugin:未能在”此应用程序“中找到Qt平台插件"android”,因为无法初始化Qt平台插件。重新安装应用程序可能会解决此问题。 可用的平台插件有: eglfs,eglfs。

工厂加载程序失败是很好的,但是为什么只有eglfs,其中两个在哪里?如何确保xcb是一个选项,并且它是默认选项?

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

可用的平台插件有: eglfs、linuxfb、最小的、最小的、屏幕外的、xcb。

我希望从我的静态编译。这里是我的QPA后端(我确实看到了用于X11的eglfs,也许这就是我必须触发的.)

代码语言:javascript
复制
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有这样的功能:

代码语言:javascript
复制
// 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)

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

代码语言:javascript
复制
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
EN

回答 1

Stack Overflow用户

发布于 2018-03-08 16:22:16

我相信,当您使用-static配置Qt时,您正在将平台插件烘焙到构建中,以后您将无法在插件之间进行交换。我不确定这一点,但我一直走在这条路上,无法让qpa的切换工作,只有一个平台插件列出。如果有办法的话,我会很想知道的!

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

代码语言:javascript
复制
./configure -no-eglfs -qpa xcb -qt-xcb -opensource -confirm-license -release -static \

祝好运

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/49109005

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档