Qt platform plugin “EGLFS” activation for linux embedded device



  • Hello, I am working on an open embedded project, and am learning about QT on the way.
    QT version 5.3.2 will not launch on my board because: "This application failed to start because it could not find or load the Qt platform plugin "eglfs"."

    This error makes sense, because I have not activated any eglfs platform plugins. Currently during the configuration of qtbase in my build, I can see the following:
    | QPA backends:
    | DirectFB ............. no
    | EGLFS ................ no
    | KMS .................. no
    | LinuxFB .............. no
    | XCB .................. no

    I learned from the following source, http://doc-snapshot.qt-project.org/qt5-dev/embedded-linux.html, that I have to set something or activate the EGLFS plugin. I have attmpted to add the following command to the qtbase.inc file:
    QT_QPA_PLATFORM = "EGLFS"
    Even when I add this command, I still only have libqminimal build as opposed to libqeglfs. So my QT_QPA_PLATFORM statement is not being set correctly.

    Does anyone have any recommendations or suggestions on how to get EGLFS to built and install correctly when I am configuring qtbase?



  • [quote author="EricZ89" date="1416000707"]
    I am getting this error with qtextstream.h.
    @
    ../../../../include/QtCore/../../../qtbase-opensource-src-5.3.2/src/corelib/io/qtextstream.h:54:2: error: #error qtextstream.h must be included before any header file that defines Status
    @

    Is this common error with eglfs?[/quote]
    This also happens with EGL on X, because the official eglplatform.h by Khronos does
    @
    ...
    #elif defined(unix)

    /* X11 (tentative) */
    #include <X11/Xlib.h>
    #include <X11/Xutil.h>

    typedef Display *EGLNativeDisplayType;
    typedef Pixmap EGLNativePixmapType;
    typedef Window EGLNativeWindowType;

    #else
    #error "Platform not recognized"
    #endif
    @

    The X11 headers define "Status", and somewhere in the Qt code, the EGL headers are included before qtextstream.h. I have not yet found a solution to this. I use Qt 5.4 and EGL 1.5.



  • Yeah it's annoying. We had some recent fixes (workarounds) for Qt 5.5. For earlier versions you can try adding the QTextStream include to the affected files before including anything else.



  • I tried the dev branch from git and it has the same problem. Maybe I'll wait for the release of 5.5.



  • Moving to Qt5.4.0 did resolve this error message for me.
    I am building an OpenEmbedded project, so I used the meta-qt5 layer: https://github.com/meta-qt5/meta-qt5.

    I found that building Qt (qtbase) was very sensitive when configuring, compiling, and installed. If you are using a dependency package version that it does not like, it will break the build and not directly tell you the root cause. For example, my QtWebKit package kept on crashing due to a futex lock and it was because I was using gstreamerv1.0 and not gstreamerv0.10, even though QtWebKit is supposed to support gstreamerv1.0.

    Here was my working Configuration Summary:
    This was built for an ARM TI AM33548ZCZ60 39AXVVW GI 9628 ZCZ processor using the Linaro ARMv7-vfp-neon-linux-gnueabihf v4.9 cross compiler.

    @ Configure summary

    Building on: /out/sysroots/x86_64-linux/usr/lib/qt5/mkspecs/linux-oe-g++ (arm, CPU features: neon)
    Building for: linux-oe-g++ (arm, CPU features: neon)

    Build options:
    Configuration .......... accessibility audio-backend c++11 clock-gettime clock-monotonic compile_examples concurrent cross_compile dbus egl egl_x11 eglfs evdev eventfd fontconfig full-config getaddrinfo getifaddrs harfbuzz icu inotify ipv6ifname large-config largefile libudev medium-config minimal-config mremap neon opengl opengles2 openssl-linked pcre png posix_fallocate qpa qpa reduce_exports release shared silent small-config system-freetype system-jpeg system-png system-zlib tslib xlib
    Build parts ............ tools libs
    Mode ................... release
    Using C++11 ............ yes
    Using gold linker....... no
    Using PCH .............. no
    Target compiler supports:
    Neon ................. yes

    Qt modules and options:
    Qt D-Bus ............... yes (loading dbus-1 at runtime)
    Qt Concurrent .......... yes
    Qt GUI ................. yes
    Qt Widgets ............. yes
    Large File ............. yes
    QML debugging .......... yes
    Use system proxies ..... no

    Support enabled for:
    Accessibility .......... yes
    ALSA ................... no
    CUPS ................... no
    Evdev .................. yes
    FontConfig ............. yes
    FreeType ............... yes (system library)
    Glib ................... no
    GTK theme .............. no
    HarfBuzz ............... yes (bundled copy)
    Iconv .................. no
    ICU .................... yes
    Image formats:
    GIF .................. yes (plugin, using bundled copy)
    JPEG ................. yes (plugin, using system library)
    PNG .................. yes (in QtGui, using system library)
    journald ............... no
    mtdev .................. no
    Networking:
    getaddrinfo .......... yes
    getifaddrs ........... yes
    IPv6 ifname .......... yes
    OpenSSL .............. yes (linked to the libraries)
    NIS .................... no
    OpenGL / OpenVG:
    EGL .................. yes
    OpenGL ............... yes (OpenGL ES 2.0+)
    OpenVG ............... no
    PCRE ................... yes (bundled copy)
    pkg-config ............. yes
    PulseAudio ............. no
    QPA backends:
    DirectFB ............. no
    EGLFS ................ yes
    KMS .................. no
    LinuxFB .............. no
    XCB .................. no
    Session management ..... no
    SQL drivers:
    DB2 .................. no
    InterBase ............ no
    MySQL ................ no
    OCI .................. no
    ODBC ................. no
    PostgreSQL ........... no
    SQLite 2 ............. no
    SQLite ............... qt-qt
    TDS .................. no
    udev ................... yes
    xkbcommon .............. no
    zlib ................... yes (system library) @



  • [quote author="agocs" date="1423825618"]For earlier versions you can try adding the QTextStream include to the affected files before including anything else.
    [/quote]

    I tried that, however I also had to do "#undef CursorShape" everywhere. Is there a bug report about all this? I didn't find one.



  • I had a similiar problem when compiling qt5.5.1 for imx6 Platform with eglfs plugin support on Linux (Mint debian)

    I used following configure options:

    ./configure -v -opensource -confirm-license -no-xcb -opengl es2 -make libs -eglfs -qpa eglfs -device linux-imx6-g++ -xplatform linux-arm-gnueabi-g++ -device-option CROSS_COMPILE=/opt/imx6_toolchain/gcc-linaro-arm-linux-gnueabihf-4.8-2013.10_linux/bin/arm-linux-gnueabihf- -sysroot <imx6_rfs> -prefix /opt/qt5.5.1

    After successfull generation of "configure" and trying to compile qt I get following error:

    <path_to_EGL_headers>/EGL/eglvivante.h:244:2: error: #error "Platform not recognized"
    #error "Platform not recognized"

    I've searched for the origin of the problem and found a little error (perhaps even a bug) in the file:
    qt-everywhere-opensource-src-5.5.1/qtbase/src/plugins/platforms/eglfs/Makefile.eglfs-plugin

    The CFLAGS and CXXFLAGS missed a Option which is spezified in the device "linux-imx6-g++" qmake.conf file
    (IMX6_CFLAGS = -march=armv7-a -mfpu=neon -DLINUX=1 -DEGL_API_FB=1)
    LINUX and EGL_API_FP are important macros to specify the needed EGL Platform API.

    In case both are not set, compiler will choose the "#error "Platform not recognized" macro.

    So I've added this to options (-DLINUX and -DEGL_API_FB) to my Makefile.eglfs-plugin:
    .
    .
    .
    CFLAGS = -pipe --sysroot=/mnt_rfs -O2 -fvisibility=hidden -fno-exceptions -Wall -W -D_REENTRANT -fPIC $(DEFINES) -DLINUX -DEGL_API_FB
    CXXFLAGS = -pipe --sysroot=/mnt_rfs -O2 -fvisibility=hidden -fvisibility-inlines-hidden -std=c++0x -fno-exceptions -Wall -W -D_REENTRANT -fPIC $(DEFINES) -DLINUX -DEGL_API_FB
    .
    .
    .

    After that the correct API was chosen from the compiler..........

    The strange thing I don't understand is, in the file Makefile.eglfs_device_lib both options are correctly set ?!
    So perhaps it's a bug/error in the qmake configuration file, but I don't know exactly.

    This Post maybe not exactly that what are you looking for....but perhaps somebody other will find it useful.


Log in to reply
 

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