Important: Please read the Qt Code of Conduct -

Qt 5.7.0 qtwayland build error with gcc6

  • I am trying to build 5.7.0 in linux with gcc 6.1.0. The module qtwayland is failing. If I skip this module, everything else builds. There are multiple errors about something "not being declared in this scope". Here is the first error:

    In file included from /home/paul/mnt/sources/build-qt/qtbase/include/QtCore/qglobal.h:1:0,
                     from ../../include/QtWaylandCompositor/../../../../../../src_mnt/sources/qt5/qtwayland/src/compositor/global/qwaylandexport.h:40,
                     from ../../include/QtWaylandCompositor/qwaylandexport.h:1,
                     from ../../include/QtWaylandCompositor/../../../../../../src_mnt/sources/qt5/qtwayland/src/compositor/global/qwaylandcompositorextension.h:40,
                     from ../../include/QtWaylandCompositor/qwaylandcompositorextension.h:1,
                     from ../../include/QtWaylandCompositor/QWaylandCompositorExtension:1,
                     from /home/paul/src_mnt/sources/qt5/qtwayland/src/compositor/extensions/qwaylandtextinput.h:40,
                     from /home/paul/src_mnt/sources/qt5/qtwayland/src/compositor/extensions/qwaylandtextinput.cpp:37:
    /home/paul/src_mnt/sources/qt5/qtwayland/src/compositor/extensions/qwaylandtextinput.cpp: In member function 'void QWaylandTextInputPrivate::sendKeyEvent(QKeyEvent*)':
    /home/paul/src_mnt/sources/qt5/qtwayland/src/compositor/extensions/qwaylandtextinput.cpp:218:35: error: 'QWaylandXkb' was not declared in this scope
         foreach (xkb_keysym_t keysym, QWaylandXkb::toKeysym(event)) {

    Here are my build commands:

    export CXXFLAGS=-fno-delete-null-pointer-checks &&
    <path_to_git_source>/configure -prefix         /opt/qt5 \
                -sysconfdir     /etc/xdg   \
                -confirm-license           \
                -opensource                \
                -dbus-linked               \
                -openssl-linked            \
                -system-harfbuzz           \
                -system-sqlite             \
                -nomake examples           \
                -no-rpath                  \
                -optimized-qmake           \
                -skip qtwebengine          &&

    Any ideas on how to fix?

  • Ok, I got this figured out. I thought it might be an issue with gcc6, so I tried on a different system with gcc5, which was successful. I compared the config.summary files from the 2 builds and saw that the unsuccessful build was attempting to use a bundled version of libxkbcommon. I installed libxkbcommon-0.6.1 on the gcc6 system and re-built. This time it was successful.


  • @Paul-H. i got the same error , and installed libxkbcommon-0.6.1,but the same error is also ~
    these days , i compiled qt5 for a lot time , but eventuily disappointed~

Log in to reply