【问题标题】:Qt 5.9 error eglfs with raspberry pi 3带有树莓派 3 的 Qt 5.9 错误 eglfs
【发布时间】:2018-01-28 15:18:50
【问题描述】:

我已经从 git 5.9.2 编译了最新版本的 qt,最新的 raspibian (2017-08-16-raspbian-stretch.img) 作为 sysroot。

我之前安装了一些库以使用 -opengl es2 进行编译。编译成功,但是当我运行应用程序时出现此错误:

此应用程序无法启动,因为它无法找到或加载 Qt 平台插件“eglfs” 在“”中。
重新安装应用程序可能会解决此问题。
放弃

我有所有必要的库,没有任何未找到的依赖项:

pi@raspberrypi:~/testrpi $ ls -lisa /usr/local/qt5pi/plugins/platforms
total 548 
260886   4 drwxr-sr-x 2 root staff   4096 août  19 14:15 .
260882   4 drwxr-sr-x 8 root staff   4096 août  19 14:32 ..
260915   8 -rwxrwxr-x 1 root staff   6976 août  19 14:15 libqeglfs.so
260932 224 -rwxrwxr-x 1 root staff 228732 août  19 14:15 libqlinuxfb.so
260930  92 -rwxrwxr-x 1 root staff  90796 août  19 14:15 libqminimalegl.so
260888  24 -rwxrwxr-x 1 root staff  21472 août  19 14:15 libqminimal.so
260890  76 -rwxrwxr-x 1 root staff  74744 août  19 14:15 libqoffscreen.so
260934 116 -rwxrwxr-x 1 root staff 116604 août  19 14:15 libqvnc.so

我已经很好地安装了 libGLESv2 和 libEGL,libeglfs 可以看到它们就像用 ldd 解决的一样:

pi@raspberrypi:~/testrpi $ ldd /usr/local/qt5pi/plugins/platforms/libqeglfs.so 
linux-vdso.so.1 (0x7ebd6000)
/usr/lib/arm-linux-gnueabihf/libarmmem.so (0x76f4f000)
libQt5EglFSDeviceIntegration.so.5 => /usr/local/qt5pi/lib/libQt5EglFSDeviceIntegration.so.5 (0x76eda000)
libQt5DBus.so.5 => /usr/local/qt5pi/lib/libQt5DBus.so.5 (0x76e6f000)
libfreetype.so.6 => /usr/lib/arm-linux-gnueabihf/libfreetype.so.6 (0x76dbf000)
libXext.so.6 => /usr/lib/arm-linux-gnueabihf/libXext.so.6 (0x76da0000)
libX11.so.6 => /usr/lib/arm-linux-gnueabihf/libX11.so.6 (0x76c7d000)
libEGL.so.1 => /usr/lib/arm-linux-gnueabihf/libEGL.so.1 (0x76c42000)
libQt5Gui.so.5 => /usr/local/qt5pi/lib/libQt5Gui.so.5 (0x768ab000)
libQt5Core.so.5 => /usr/local/qt5pi/lib/libQt5Core.so.5 (0x7643b000)
libdl.so.2 => /lib/arm-linux-gnueabihf/libdl.so.2 (0x76428000)
libGLESv2.so.2 => /usr/lib/arm-linux-gnueabihf/libGLESv2.so.2 (0x7640e000)
libpthread.so.0 => /lib/arm-linux-gnueabihf/libpthread.so.0 (0x763e5000)
libstdc++.so.6 => /usr/lib/arm-linux-gnueabihf/libstdc++.so.6 (0x7629d000)
libgcc_s.so.1 => /lib/arm-linux-gnueabihf/libgcc_s.so.1 (0x76270000)
libc.so.6 => /lib/arm-linux-gnueabihf/libc.so.6 (0x76131000)
libz.so.1 => /lib/arm-linux-gnueabihf/libz.so.1 (0x7610a000)
libpng16.so.16 => /usr/lib/arm-linux-gnueabihf/libpng16.so.16 (0x760d0000)
/lib/ld-linux-armhf.so.3 (0x76f76000)
libxcb.so.1 => /usr/lib/arm-linux-gnueabihf/libxcb.so.1 (0x760a1000)
libX11-xcb.so.1 => /usr/lib/arm-linux-gnueabihf/libX11-xcb.so.1 (0x7608f000)
libxcb-dri2.so.0 => /usr/lib/arm-linux-gnueabihf/libxcb-dri2.so.0 (0x7607b000)
libxcb-xfixes.so.0 => /usr/lib/arm-linux-gnueabihf/libxcb-xfixes.so.0 (0x76064000)
libxcb-dri3.so.0 => /usr/lib/arm-linux-gnueabihf/libxcb-dri3.so.0 (0x76051000)
libxcb-present.so.0 => /usr/lib/arm-linux-gnueabihf/libxcb-present.so.0 (0x7603e000)
libxcb-sync.so.1 => /usr/lib/arm-linux-gnueabihf/libxcb-sync.so.1 (0x76028000)
libxshmfence.so.1 => /usr/lib/arm-linux-gnueabihf/libxshmfence.so.1 (0x76016000)
libwayland-client.so.0 => /usr/lib/arm-linux-gnueabihf/libwayland-client.so.0 (0x75ffc000)
libwayland-server.so.0 => /usr/lib/arm-linux-gnueabihf/libwayland-server.so.0 (0x75fdf000)
libgbm.so.1 => /usr/lib/arm-linux-gnueabihf/libgbm.so.1 (0x75fc4000)
libexpat.so.1 => /lib/arm-linux-gnueabihf/libexpat.so.1 (0x75f92000)
libm.so.6 => /lib/arm-linux-gnueabihf/libm.so.6 (0x75f13000)
libdrm.so.2 => /usr/lib/arm-linux-gnueabihf/libdrm.so.2 (0x75ef6000)
libglapi.so.0 => /usr/lib/arm-linux-gnueabihf/libglapi.so.0 (0x75ebd000)
libXau.so.6 => /usr/lib/arm-linux-gnueabihf/libXau.so.6 (0x75eb2000)
libXdmcp.so.6 => /usr/lib/arm-linux-gnueabihf/libXdmcp.so.6 (0x75e9d000)
libffi.so.6 => /usr/lib/arm-linux-gnueabihf/libffi.so.6 (0x75e85000)
librt.so.1 => /lib/arm-linux-gnueabihf/librt.so.1 (0x75e6e000)
libbsd.so.0 => /lib/arm-linux-gnueabihf/libbsd.so.0 (0x75e45000)

我测试了使用 libqeglfs.so 的位置设置 QT_QPA_PLATFORM_PLUGIN_PATH 但同样的错误仍然存​​在:

此应用程序无法启动,因为它无法找到或加载 Qt 平台插件“eglfs”
在“/usr/local/qt5pi/plugins/platforms”中。
重新安装应用程序可能会解决此问题。
放弃

我需要你的帮助来解决这个严重的问题! 谢谢。

关于配置的更新

配置命令:

./configure -opengl es2 -device linux-rasp-pi3-g++ -device-option CROSS_COMPILE=~/opt/gcc-linaro-5.4.1-2017.05-i686_arm-linux-gnueabihf/bin/arm-linux-gnueabihf- -sysroot /mnt/rasp-pi-rootfs -opensource -confirm-license -reduce-exports -release -make libs -make tools -prefix /usr/local/qt5pi -hostprefix /usr/local/qt5pi -no-use-gold-linker

输出:

Configure summary:

Building on: linux-g++ (x86_64, CPU features: mmx sse sse2)
Building for: devices/linux-rasp-pi3-g++ (arm, CPU features: neon)
Configuration: cross_compile compile_examples enable_new_dtags largefile neon precompile_header shared rpath release c++11 c++14 c++1z concurrent dbus reduce_exports stl
Build options:
  Mode ................................... release
  Optimize release build for size ........ no
  Building shared libraries .............. yes
  Using C++ standard ..................... C++1z
  Using gold linker ...................... no
  Using new DTAGS ........................ yes
  Using precompiled headers .............. yes
  Using LTCG ............................. no
  Target compiler supports:
    NEON ................................. yes
  Build parts ............................ libs tools
Qt modules and options:
  Qt Concurrent .......................... yes
  Qt D-Bus ............................... yes
  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
  QML debugging .......................... yes
  udev ................................... no
  Using system zlib ...................... yes
Qt Core:
  DoubleConversion ....................... yes
    Using system DoubleConversion ........ no
  GLib ................................... no
  iconv .................................. yes
  ICU .................................... no
  Logging backends:
    journald ............................. no
    syslog ............................... no
    slog2 ................................ no
  Using system PCRE2 ..................... no
Qt Network:
  getaddrinfo() .......................... yes
  getifaddrs() ........................... yes
  IPv6 ifname ............................ yes
  libproxy ............................... no
  OpenSSL ................................ no
    Qt directly linked to OpenSSL ........ no
  SCTP ................................... no
  Use system proxies ..................... yes
Qt Gui:
  Accessibility .......................... yes
  FreeType ............................... yes
    Using system FreeType ................ yes
  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 ................ yes
  EGL .................................... yes
  OpenVG ................................. no
  OpenGL:
    Desktop OpenGL ....................... no
    OpenGL ES 2.0 ........................ yes
    OpenGL ES 3.0 ........................ yes
    OpenGL ES 3.1 ........................ yes
  Session Management ..................... yes
Features used by QPA backends:
  evdev .................................. yes
  libinput ............................... no
  INTEGRITY HID .......................... no
  mtdev .................................. no
  tslib .................................. no
  xkbcommon-evdev ........................ no
QPA backends:
  DirectFB ............................... no
  EGLFS .................................. yes
  EGLFS details:
    EGLFS i.Mx6 .......................... no
    EGLFS i.Mx6 Wayland .................. no
    EGLFS EGLDevice ...................... yes
    EGLFS GBM ............................ no
    EGLFS Mali ........................... no
    EGLFS Raspberry Pi ................... no
    EGL on X11 ........................... yes
  LinuxFB ................................ yes
  VNC .................................... yes
  Mir client ............................. no
Qt Widgets:
  GTK+ ................................... no
  Styles ................................. Fusion Windows
Qt PrintSupport:
  CUPS ................................... no
Qt Sql:
  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

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

Qt is now configured for building. Just run 'make'.
Once everything is built, you must run 'make install'.
Qt will be installed into '/mnt/rasp-pi-rootfs/usr/local/qt5pi'.

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

【问题讨论】:

  • @AlexanderVX :谢谢,但没有什么可以解决这个问题,因为所有提到的事情都已经完成,但问题仍然存在(我也检查了 linuxfb。)编译我遵循这里提到的主要步骤wiki.qt.io/Raspberry_Pi_Beginners_Guide
  • 请显示您提供的完整配置命令行。通过传递-device rasp-pi3-vc4,您的 eglfs 插件不应依赖于任何 X11/wayland 库。相反,您似乎正在链接到开源 Mesa 驱动程序,因此您需要检查那里是否正确安装了所有内容。
  • @MassimoCallegari 我用配置命令和输出更新了帖子。我用的是 rasp-pi3 而不是 vc4 ?这是错的吗?
  • @requinham 没错。只是 Mesa VC4 仍在进行中,而专有的 BCM VC4 已经过很好的测试。我通常构建专有方式。换句话说:插件的 ldd 可能不会告诉你全部真相。只需尝试 ldd 所有 qeglfsplugin 依赖项,直到找到丢失的那个。必须有一个。

标签: qt raspberry-pi3 debian-jessie qt5.9 eglfs


【解决方案1】:

我发现了至少一个问题。

从这个开始:您的配置显示您使用的是标准设备 linux-rasp-pi3-g++,但您的 ldd 显示您的应用链接到GLES 的 Mesa 版本:

libGLESv2.so.2 => /usr/lib/arm-linux-gnueabihf/libGLESv2.so.2

据我了解,如果你使用linux-rasp-pi3-g++,你必须使用/opt/vc/lib/中Broadcom提供的GLES和EGL。

解决办法:

  1. 卸载官方 Mesa:libgles2-mesalibegl-mesa(包名来自内存)
  2. /opt/vc/lib/ 中的每个库符号链接到/usr/lib/arm-linux-gnueabihf/
  3. 添加缺少的符号链接:sudo ln -s libEGL.so libEGL.so.1sudo ln -s libGLESv2.so libGLESv2.so.2

提示:在摆脱 Mesa 之前尝试export LD_LIBRARY_PATH=/opt/vc/lib/ your-executable

【讨论】:

  • 我也尝试过这种方式,但在我测试的那一刻没有结果。将不得不再次重新测试。
猜你喜欢
  • 2018-07-08
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2013-07-18
  • 2013-11-30
  • 1970-01-01
  • 1970-01-01
  • 2018-10-15
相关资源
最近更新 更多