Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Error when Runnning Qt example on Arm Cortex-A9:could not find or load the Qt platform plugin "linuxfb"



  • Recently I've cross compiled QT 5.6 using arm-linux-gnueabihf in my ubuntu 14.04.And after I build up everything,I just mvoe it to the target board for a check.And things went unexpected when i run the analogclock:

    root@FriendlyELEC:/usr/local/qt_sdk/examples/gui/analogclock# ./analogclock 
    This application failed to start because it could not find or load the Qt platform plugin "linuxfb"
    in "/usr/local/qt_sdk/plugins/platforms".
    
    Available platform plugins are: linuxfb (from /usr/local/qt_sdk/plugins/platforms), minimal (from /usr/local/qt_sdk/plugins/platforms), offscreen (from /usr/local/qt_sdk/plugins/platforms).
    
    Reinstalling the application may fix this problem.
    Aborted (core dumped)
    root@FriendlyELEC:/usr/local/qt_sdk/examples/gui/analogclock# 
    
    

    It puzzled me because the system had found the .so files but unable to carry out.
    And it seems that my configuration is not to blame.This is part of my /etc/profile:

    export QTDIR=/usr/local/qt_sdk
    export QT_QPA_FONTDIR=$QTDIR/lib/fonts
    #export QT_PLUGIN_PATH=$QTDIR/plugins/platforms
    export QT_QPA_PLATFORM_PLUGIN_PATH=$QTDIR/plugins/platforms
    export LD_LIBRARY_PATH=$QTDIR/lib:$LD_LIBRARY_PATH
    #export LD_LIBRARY_PATH=/usr/lib/arm-linux-gnueabihf/:$LD_LIBRARY_PATH
    export QT_QPA_PLATFORM=linuxfb:fb=/dev/fb0:size=800x600:mmSize=800x600:offset=0xx
    0:tty=/dev/tty1
    #framebuffer
    export QWS_MOUSE_PROTO=/dev/input/event0
    export QT_PLUGIN_PATH=$QTDIR/plugins/platforms/
    
    export PATH=$QTDIR/bin:$PATH
    
    

    And I also checked my directory:

    root@FriendlyELEC:/usr/local/qt_sdk# ls plugins/platforms
    libqlinuxfb.so  libqminimal.so  libqoffscreen.so  libqxcb.so
    
    

    And now I am wondering that maybe I got something wrong with my cross-compiling.Before I cross compiled the QT,I have set the env var PKG_CONFIG_LIBDIR:

    root@ming-2-00:~/qt-everywhere-opensource-src-5.6.0# echo $PKG_CONFIG_LIBDIR
    /usr/lib/arm-linux-gnueabihf/pkgconfig
    
    

    This is what I used for cross compiling QT:

    #!/bin/sh
    ./configure -prefix /opt/arm/qt5.6_64/qt_sdk \
    -opensource \
    -release \
    -no-pch \
    -confirm-license \
    -xplatform linux-arm-gnueabi-g++ \
    -shared \
    -qt-zlib \
    -iconv \
    -no-gif \
    -no-nis \
    -qt-libjpeg \
    -no-opengl \
    -no-cups \
    -no-glib \
    -no-dbus \
    -no-rpath \
    -no-sse2 -no-sse3 -no-ssse3 -no-sse4.1 -no-sse4.2 \
    -no-avx \
    -no-openssl \
    -nomake tools \
    -v \
    -qreal float \
    -qt-libpng \
    -qt-xcb \
    -make examples
    
    

    could anybody told me what's the mistake I shall fix?or what i miss?


  • Lifetime Qt Champion

    Hi and welcome to devnet,

    You should run ldd on the plugin to see if you have all dependencies installed on your device.


Log in to reply