EGLFS problem of Qt 5.7 on Raspberry



  • Hi guys.
    I now face a strange problem.
    I just cross compile and build and install qt5.7 on raspberry pi3. Everything seems well, but when I want to use eglfs, it shows

    This application failed to start because it could not find or load the Qt platform plugin "eglfs"
    in "".
    
    Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, xcb.
    
    Reinstalling the application may fix this problem.
    

    but my platforms.so files are already install in the /usr/local/qt5pi-5.7/plugins/platforms, show as follow.

    lxy@lxy:/usr/local/qt5pi-5.7/plugins/platforms$ ls
    libqeglfs.a      libqlinuxfb.so      libqminimal.prl    libqxcb.a
    libqeglfs.prl    libqminimal.a       libqminimal.so     libqxcb.prl
    libqeglfs.so     libqminimalegl.a    libqoffscreen.a    libqxcb.so
    libqlinuxfb.a    libqminimalegl.prl  libqoffscreen.prl
    libqlinuxfb.prl  libqminimalegl.so   libqoffscreen.so
    

    And I also run ldd libqeglfs.so and it shows as follow.

    lxy@lxy:/usr/local/qt5pi-5.7/plugins/platforms$ ldd libqeglfs.so
    	linux-vdso.so.1 =>  (0x7eedd000)
    	/usr/lib/arm-linux-gnueabihf/libarmmem.so (0x76f6a000)
    	libQt5EglDeviceIntegration.so.5 => /usr/local/qt5pi-5.7/plugins/platforms/./../../lib/libQt5EglDeviceIntegration.so.5 (0x76e9b000)
    	libts-0.0.so.0 => /usr/local/tslib/lib/libts-0.0.so.0 (0x76e63000)
    	libfontconfig.so.1 => /usr/lib/arm-linux-gnueabihf/libfontconfig.so.1 (0x76e26000)
    	libfreetype.so.6 => /usr/lib/arm-linux-gnueabihf/libfreetype.so.6 (0x76daf000)
    	libQt5DBus.so.5 => /usr/local/qt5pi-5.7/plugins/platforms/./../../lib/libQt5DBus.so.5 (0x76d37000)
    	libXext.so.6 => /usr/lib/arm-linux-gnueabihf/libXext.so.6 (0x76d1b000)
    	libX11.so.6 => /usr/lib/arm-linux-gnueabihf/libX11.so.6 (0x76c2a000)
    	libdl.so.2 => /lib/arm-linux-gnueabihf/libdl.so.2 (0x76c17000)
    	libgthread-2.0.so.0 => /usr/lib/arm-linux-gnueabihf/libgthread-2.0.so.0 (0x76c05000)
    	libglib-2.0.so.0 => /lib/arm-linux-gnueabihf/libglib-2.0.so.0 (0x76b2d000)
    	libEGL.so => /opt/vc/lib/libEGL.so (0x76af3000)
    	libQt5Gui.so.5 => /usr/local/qt5pi-5.7/plugins/platforms/./../../lib/libQt5Gui.so.5 (0x766ad000)
    	libQt5Core.so.5 => /usr/local/qt5pi-5.7/plugins/platforms/./../../lib/libQt5Core.so.5 (0x761fd000)
    	libGLESv2.so => /opt/vc/lib/libGLESv2.so (0x761d8000)
    	libpthread.so.0 => /lib/arm-linux-gnueabihf/libpthread.so.0 (0x761b4000)
    	libstdc++.so.6 => /usr/lib/arm-linux-gnueabihf/libstdc++.so.6 (0x760a5000)
    	libm.so.6 => /lib/arm-linux-gnueabihf/libm.so.6 (0x7602d000)
    	libgcc_s.so.1 => /lib/arm-linux-gnueabihf/libgcc_s.so.1 (0x76005000)
    	libc.so.6 => /lib/arm-linux-gnueabihf/libc.so.6 (0x75f19000)
    	/lib/ld-linux-armhf.so.3 (0x54b7e000)
    	libexpat.so.1 => /lib/arm-linux-gnueabihf/libexpat.so.1 (0x75ef1000)
    	libz.so.1 => /lib/arm-linux-gnueabihf/libz.so.1 (0x75ece000)
    	libpng12.so.0 => /lib/arm-linux-gnueabihf/libpng12.so.0 (0x75ea6000)
    	libxcb.so.1 => /usr/lib/arm-linux-gnueabihf/libxcb.so.1 (0x75e82000)
    	libpcre.so.3 => /lib/arm-linux-gnueabihf/libpcre.so.3 (0x75e25000)
    	libbcm_host.so => /opt/vc/lib/libbcm_host.so (0x75dff000)
    	libvchiq_arm.so => /opt/vc/lib/libvchiq_arm.so (0x75de8000)
    	libvcos.so => /opt/vc/lib/libvcos.so (0x75dce000)
    	librt.so.1 => /lib/arm-linux-gnueabihf/librt.so.1 (0x75db8000)
    	libpcre16.so.3 => /usr/lib/arm-linux-gnueabihf/libpcre16.so.3 (0x75d62000)
    	libXau.so.6 => /usr/lib/arm-linux-gnueabihf/libXau.so.6 (0x75d56000)
    	libXdmcp.so.6 => /usr/lib/arm-linux-gnueabihf/libXdmcp.so.6 (0x75d42000)
    

    All libs are linked but why it still cannot find eglfs? How to fix it?



  • After I added QT_QPA_PLATFORM_PLUGIN_PATH, it shows as folllow.

    This application failed to start because it could not find or load the Qt platform plugin "eglfs"
    in "/usr/local/qt5pi-5.7/plugins/platforms".
    
    Available platform plugins are: eglfs (from /usr/local/qt5pi-5.7/plugins/platforms), linuxfb (from /usr/local/qt5pi-5.7/plugins/platforms), minimal (from /usr/local/qt5pi-5.7/plugins/platforms), minimalegl (from /usr/local/qt5pi-5.7/plugins/platforms), offscreen (from /usr/local/qt5pi-5.7/plugins/platforms), xcb (from /usr/local/qt5pi-5.7/plugins/platforms), linuxfb, minimal, minimalegl, offscreen, xcb.
    

    I'm really confused. Why the application failed to find eglfs, but qt says eglfs is available. And the eglfs is under the same path as I set.
    I really need help!


  • Moderators

    @ascnp It probably failed to load the plug-in. Is the plug-in built for the same architecture? Is the file maybe corrupted?
    Set QT_DEBUG_PLUGINS variable before starting your application, maybe you will then see what happens (http://doc.qt.io/qt-5/debug.html).



  • @jsulm I have rebuilt the qt5.7 and finally it can use, thanks for your help!



  • @ascnp Could you please share the guide you followed to build the cross compilation environment for pi?


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.