KcFnMi
KcFnMi

Reputation: 6161

Could not find the Qt platform plugin xcb, on Qt5 build from source on Linux

I build Qt5 on Debian 10 32 bits. Then I created a minimal Qt project, run $ ~/qt/qt-everywhere-src-5.12.7/qtbase/bin/qmake project.pro and make, but when I tried to execute the application I go the following:

What's going on?

$ ./release/project 
qt.qpa.plugin: Could not find the Qt platform plugin "xcb" in ""
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

Available platform plugins are: linuxfb, minimal, offscreen, vnc, webgl.

Aborted

More info:

$ QT_DEBUG_PLUGINS=1 release/project 
QFactoryLoader::QFactoryLoader() checking directory path "/home/user/qt/qt-everywhere-src-5.12.7/qtbase/plugins/platforms" ...
QFactoryLoader::QFactoryLoader() looking at "/home/user/qt/qt-everywhere-src-5.12.7/qtbase/plugins/platforms/libqlinuxfb.so"
Found metadata in lib /home/user/qt/qt-everywhere-src-5.12.7/qtbase/plugins/platforms/libqlinuxfb.so, metadata=
{
    "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
    "MetaData": {
        "Keys": [
            "linuxfb"
        ]
    },
    "archreq": 0,
    "className": "QLinuxFbIntegrationPlugin",
    "debug": false,
    "version": 330752
}


Got keys from plugin meta data ("linuxfb")
QFactoryLoader::QFactoryLoader() looking at "/home/user/qt/qt-everywhere-src-5.12.7/qtbase/plugins/platforms/libqminimal.so"
Found metadata in lib /home/user/qt/qt-everywhere-src-5.12.7/qtbase/plugins/platforms/libqminimal.so, metadata=
{
    "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
    "MetaData": {
        "Keys": [
            "minimal"
        ]
    },
    "archreq": 0,
    "className": "QMinimalIntegrationPlugin",
    "debug": false,
    "version": 330752
}


Got keys from plugin meta data ("minimal")
QFactoryLoader::QFactoryLoader() looking at "/home/user/qt/qt-everywhere-src-5.12.7/qtbase/plugins/platforms/libqoffscreen.so"
Found metadata in lib /home/user/qt/qt-everywhere-src-5.12.7/qtbase/plugins/platforms/libqoffscreen.so, metadata=
{
    "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
    "MetaData": {
        "Keys": [
            "offscreen"
        ]
    },
    "archreq": 0,
    "className": "QOffscreenIntegrationPlugin",
    "debug": false,
    "version": 330752
}


Got keys from plugin meta data ("offscreen")
QFactoryLoader::QFactoryLoader() looking at "/home/user/qt/qt-everywhere-src-5.12.7/qtbase/plugins/platforms/libqvnc.so"
Found metadata in lib /home/user/qt/qt-everywhere-src-5.12.7/qtbase/plugins/platforms/libqvnc.so, metadata=
{
    "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
    "MetaData": {
        "Keys": [
            "vnc"
        ]
    },
    "archreq": 0,
    "className": "QVncIntegrationPlugin",
    "debug": false,
    "version": 330752
}


Got keys from plugin meta data ("vnc")
QFactoryLoader::QFactoryLoader() looking at "/home/user/qt/qt-everywhere-src-5.12.7/qtbase/plugins/platforms/libqwebgl.so"
Found metadata in lib /home/user/qt/qt-everywhere-src-5.12.7/qtbase/plugins/platforms/libqwebgl.so, metadata=
{
    "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
    "MetaData": {
        "Keys": [
            "webgl"
        ]
    },
    "archreq": 0,
    "className": "QWebGLIntegrationPlugin",
    "debug": false,
    "version": 330752
}


Got keys from plugin meta data ("webgl")
QFactoryLoader::QFactoryLoader() checking directory path "/home/user/QtProjects/project/release/platforms" ...
qt.qpa.plugin: Could not find the Qt platform plugin "xcb" in ""
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

Available platform plugins are: linuxfb, minimal, offscreen, vnc, webgl.

Aborted

Upvotes: 0

Views: 2122

Answers (2)

Musa
Musa

Reputation: 514

I think you've compiled Qt5 without xcb libraries. and so you have no xcb plugin in '/your-qt-path/plugins/platforms/'.

As document of qt says too, it's recommended that you install this packages first:

libfontconfig1-dev
libfreetype6-dev
libx11-dev
libx11-xcb-dev
libxext-dev
libxfixes-dev
libxi-dev
libxrender-dev
libxcb1-dev
libxcb-cursor-dev
libxcb-glx0-dev
libxcb-keysyms1-dev
libxcb-image0-dev
libxcb-shm0-dev
libxcb-icccm4-dev
libxcb-sync-dev
libxcb-xfixes0-dev
libxcb-shape0-dev
libxcb-randr0-dev
libxcb-render-util0-dev
libxcb-util-dev
libxcb-xinerama0-dev
libxcb-xkb-dev
libxkbcommon-dev
libxkbcommon-x11-dev

After that, delete config.cache, and rerun ./configure. and when your compile finished, you should see 'libqxcb.so' file in 'platform' directory too.

Upvotes: 0

burnack
burnack

Reputation: 9

libqxcb.so should be found in the platforms subdir of your application. if you want to change its searched location have a look at qt.conf ini file that controls plugins search path among other paths

Upvotes: 0

Related Questions