Important: Please read the Qt Code of Conduct -

Qt5.2.0 static + eglfs cannot run example hellogl_es2

  • Hello all,

    I downloaded t Qt5.2.0 version and wanted to compile it with static build
    and platform eglfs which can run on imx6 board.

    Here is my configure option:

    ./configure -prefix /usr/local/Qt5.2.0-imx6-static -v -opensource -confirm-licen
    se -release -static -opengl es2 -device imx6 -device-option CROSS_COMPILE=/opt/freescale/
    inux-gnueabi- -sysroot /my_rootfs -no-gcc-sysroot -nomake examples -no-xcb
    -eglfs -no-pch -no-javascript-jit -no-c++11 -no-icu

    There was no any error when ran on the steps configure, make, make install.
    Therefore I wanted to run a simple example with static version.

    I compiled this example of Qt5.2:

    and I modified the .pro and main.cpp file like this:

    @QT += opengl widgets

    SOURCES += main.cpp
    SOURCES += glwidget.cpp
    SOURCES += mainwindow.cpp
    SOURCES += bubble.cpp

    HEADERS += glwidget.h
    HEADERS += mainwindow.h
    HEADERS += bubble.h

    RESOURCES += texture.qrc


    target.path = $$[QT_INSTALL_EXAMPLES]/opengl/hellogl_es2
    INSTALLS += target

    maemo5 {
    # Debian package name may not contain numbers or special characters
    # such as '_', lets change this in Maemo.
    TARGET = helloglestwo
    CONFIG += qt_example

    the following is the new added

    CONFIG += static
    contains(CONFIG, static) {
    LIBS += -L/my_rootfs/usr/local/Qt5.2.0-imx6-static/plugins/platforms/
    LIBS += -L/my_rootfs/usr/local/Qt5.2.0-imx6-static/plugins/generic/
    LIBS += -lqtslibplugin -lqeglfs


    @#include <QApplication>
    #include <QMainWindow>
    #include "mainwindow.h"

    //Here is the new added
    #include <QtPlugin>

    int main( int argc, char ** argv )
    QApplication a( argc, argv );
    MainWindow mw;
    return a.exec();

    There was no error when compiling this example,
    but when I wanted to run this example with these options:

    ./hellogl_es2 -platform eglfs

    It appeared these messages:

    This plugin does not support propagateSizeHints()
    This plugin does not support setParent!
    EGLFS: OpenGL windows cannot be mixed with others.

    By the way, I also modifed the file qeglfshooks_imx6.cpp in the path
    and added a function like this:

    @EGLNativeWindowType QEglFSImx6Hooks::createNativeWindow(QPlatformWindow *platformWindow,
    const QSize &size,
    const QSurfaceFormat &format)
    EGLNativeWindowType eglWindow = fbCreateWindow(mNativeDisplay, 0, 0, size.width(), size.height());
    return eglWindow;

    Because I found that without this function, the program would call the function createNativeWindow
    in the qeglfshooks_stub.cpp and would result in m_surface error in the function resetSurface() and cause the warning :
    EGL Error : Could not create the egl surface: error = 0x300b

    But I am not sure whether it is a bug or not.

    Anyway, I could not run this program normally, so I modified another example "hellowindow".
    The hellowindow result looks like this:
    EGLFS: OpenGL windows cannot be mixed with others.
    (I noticed that no appeared the message "This plugin does not...")

    I searched on the internet but do not see the similar problem,
    so I post here to ask for help.
    If there is similar or the same problem, please also inform me.

    Thank you all.
    Best Regards

  • Ok, the hooks may be broken in 5.2.0 then. They are correct in 5.2.1 and 5.3.

    As for the other question, see
    The application terminates as expected.
    The inability to mix OpenGL windows with other content will be resolved later by the introduction of QOpenGLWidget and QQuickWidget. These will then be properly supported on all platforms.

    For the time being, avoid having mixed UIs like the one in hellogl_es2.

  • Thanks for agocs' reply.

    I downloaded Qt5.2.1 version and rebuilt it again with the same configure option, and there was no any error.
    However the problem of examples hellogl_es2 and hellowindow is the same like before:

    This plugin does not support propagateSizeHints()
    This plugin does not support setParent!
    EGLFS: OpenGL windows cannot be mixed with others.

    So Qt5.2.1 version doesn't correct this problem yet? :(

    By the way, I looked about the code in the qeglfshooks_imx6.cpp, and it was really modified like I modified before.

    I also tested another simple program I wrote, and I found some error.
    Here is my program:


    @#include <QGuiApplication>
    #include <QtQuick/QQuickView>
    #include <QTextCodec>

    #include <QtPlugin>

    int main(int argc, char **argv)
    QGuiApplication app(argc, argv);
    QTextCodec *codec = QTextCodec::codecForName("Utf-8");

    QQuickView view;

    return app.exec();

    main.qml :

    @import QtQuick 2.0

    Item {
    width: 800
    height: 480

    Rectangle {
        id: rect
        width: 800
        height: 480
        color:  "lime"
        Text {
            text: "Hello"
            color: "red"
            anchors.centerIn: parent


    When I ran this program like this:

    ./simple_qt5 -platform eglfs

    I saw the warning:

    Warning: distance-field glyph is not available with index 0

    Even I copied the folder fonts to /Qt5.2.1-imx6-static/lib/, it showed the same warning.

    Is this a problem in Qt5.2.1 too?

    Anyway, thank you all for helping me.
    Best Regards.

  • It (the error about multiple opengl windows) is not a bug, it's a feature. :) hellogl_es2 will never work on platforms like eglfs.

    As for hellowindow, that works fine, just launch with --single. By default it tries to open 3 windows which won't fly.

    As for the text rendering issue, not sure. I have also seen the the warning about glyphs not being available before but then it went away with recent Qt versions, I think. Perhaps just retest with 5.2.1.

  • Hello, I am quite late but I just faced more or less the same problem (with Qt 5.2.1 on TI AM335x) and I found a solution.

    Even in my case Qt said "Warning: distance-field glyph in not available with index 0" and in my case it was due to the fact that Qt couldn't find fonts (in my case the text on screen appeared as a set of squares).

    This was due to the fact that Qt was cross-compiled with fontconfig support (and system freetype) and so Qt searched for fonts in /usr/share/fonts (at least on my system) instead of /prefix-path/lib/fonts. Copying fonts to /usr/share/fonts fixed the problem.

    The issue is quite subtle because fontconfig and system freetype were enabled by ./configure (due to pkgconfig in my sysroot)... if you want to use Qt embedded support for fonts I think it is enough to cross-compile it specifying -no-fontconfig and -qt-freetype (in this case fonts should be in /prefix-path/lib/fonts).

Log in to reply