无法在“”中加载 Qt 平台插件“xcb”,尽管已找到

无法在“”中加载 Qt 平台插件“xcb”,尽管已找到

首先我要说的是,我不是一个经验丰富的Linux用户,所以请不要太过担心。技术性的' 和我一起。
我正在尝试安装视窗多媒体Xubuntu 20.04 上的软件包,但是我收到了这个错误:

qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
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, minimalegl, offscreen, vnc, wayland-egl, wayland, wayland-xcomposite-egl, wayland-xcomposite-glx, xcb.

Aborted (core dumped)

我在谷歌上搜索解决方案,但没有找到。我唯一明白的是,我缺少应用程序依赖的一些库?我已经试过了解决方案,sudo apt-get install libx11-xcb1以及我在各个网站上找到的其他一些解决方案,但我仍然遇到同样的问题。

答案1

我能够通过安装缺失的软件包来解决这个问题。这些是我执行的步骤:

  1. 我设置了调试插件使用export QT_DEBUG_PLUGINS=1命令 1 并运行视窗来自同一命令行。它返回以下输出:
QFactoryLoader::QFactoryLoader() checking directory path "/opt/XnView/lib/platforms" ...
QFactoryLoader::QFactoryLoader() looking at "/opt/XnView/lib/platforms/libqlinuxfb.so"
Found metadata in lib /opt/XnView/lib/platforms/libqlinuxfb.so, metadata=
{
    "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
    "MetaData": {
        "Keys": [
            "linuxfb"
        ]
    },
    "archreq": 0,
    "className": "QLinuxFbIntegrationPlugin",
    "debug": false,
    "version": 331520
}


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


Got keys from plugin meta data ("minimal")
QFactoryLoader::QFactoryLoader() looking at "/opt/XnView/lib/platforms/libqminimalegl.so"
Found metadata in lib /opt/XnView/lib/platforms/libqminimalegl.so, metadata=
{
    "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
    "MetaData": {
        "Keys": [
            "minimalegl"
        ]
    },
    "archreq": 0,
    "className": "QMinimalEglIntegrationPlugin",
    "debug": false,
    "version": 331520
}


Got keys from plugin meta data ("minimalegl")
QFactoryLoader::QFactoryLoader() looking at "/opt/XnView/lib/platforms/libqoffscreen.so"
Found metadata in lib /opt/XnView/lib/platforms/libqoffscreen.so, metadata=
{
    "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
    "MetaData": {
        "Keys": [
            "offscreen"
        ]
    },
    "archreq": 0,
    "className": "QOffscreenIntegrationPlugin",
    "debug": false,
    "version": 331520
}


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


Got keys from plugin meta data ("vnc")
QFactoryLoader::QFactoryLoader() looking at "/opt/XnView/lib/platforms/libqwayland-egl.so"
Found metadata in lib /opt/XnView/lib/platforms/libqwayland-egl.so, metadata=
{
    "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
    "MetaData": {
        "Keys": [
            "wayland-egl"
        ]
    },
    "archreq": 0,
    "className": "QWaylandEglPlatformIntegrationPlugin",
    "debug": false,
    "version": 331520
}


Got keys from plugin meta data ("wayland-egl")
QFactoryLoader::QFactoryLoader() looking at "/opt/XnView/lib/platforms/libqwayland-generic.so"
Found metadata in lib /opt/XnView/lib/platforms/libqwayland-generic.so, metadata=
{
    "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
    "MetaData": {
        "Keys": [
            "wayland"
        ]
    },
    "archreq": 0,
    "className": "QWaylandIntegrationPlugin",
    "debug": false,
    "version": 331520
}


Got keys from plugin meta data ("wayland")
QFactoryLoader::QFactoryLoader() looking at "/opt/XnView/lib/platforms/libqwayland-xcomposite-egl.so"
Found metadata in lib /opt/XnView/lib/platforms/libqwayland-xcomposite-egl.so, metadata=
{
    "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
    "MetaData": {
        "Keys": [
            "wayland-xcomposite-egl"
        ]
    },
    "archreq": 0,
    "className": "QWaylandXCompositeEglPlatformIntegrationPlugin",
    "debug": false,
    "version": 331520
}


Got keys from plugin meta data ("wayland-xcomposite-egl")
QFactoryLoader::QFactoryLoader() looking at "/opt/XnView/lib/platforms/libqwayland-xcomposite-glx.so"
Found metadata in lib /opt/XnView/lib/platforms/libqwayland-xcomposite-glx.so, metadata=
{
    "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
    "MetaData": {
        "Keys": [
            "wayland-xcomposite-glx"
        ]
    },
    "archreq": 0,
    "className": "QWaylandXCompositeGlxPlatformIntegrationPlugin",
    "debug": false,
    "version": 331520
}


Got keys from plugin meta data ("wayland-xcomposite-glx")
QFactoryLoader::QFactoryLoader() looking at "/opt/XnView/lib/platforms/libqwebgl.so"
Found metadata in lib /opt/XnView/lib/platforms/libqwebgl.so, metadata=
{
    "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
    "MetaData": {
        "Keys": [
            "webgl"
        ]
    },
    "archreq": 0,
    "className": "QWebGLIntegrationPlugin",
    "debug": false,
    "version": 331520
}


Got keys from plugin meta data ("webgl")
QFactoryLoader::QFactoryLoader() looking at "/opt/XnView/lib/platforms/libqxcb.so"
Found metadata in lib /opt/XnView/lib/platforms/libqxcb.so, metadata=
{
    "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
    "MetaData": {
        "Keys": [
            "xcb"
        ]
    },
    "archreq": 0,
    "className": "QXcbIntegrationPlugin",
    "debug": false,
    "version": 331520
}


Got keys from plugin meta data ("xcb")
QFactoryLoader::QFactoryLoader() checking directory path "/opt/XnView/platforms" ...
Cannot load library /opt/XnView/lib/platforms/libqxcb.so: (libxcb-icccm.so.4: cannot open shared object file: No such file or directory)
QLibraryPrivate::loadPlugin failed on "/opt/XnView/lib/platforms/libqxcb.so" : "Cannot load library /opt/XnView/lib/platforms/libqxcb.so: (libxcb-icccm.so.4: cannot open shared object file: No such file or directory)"
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
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, minimalegl, offscreen, vnc, wayland-egl, wayland, wayland-xcomposite-egl, wayland-xcomposite-glx, webgl, xcb.

Aborted (core dumped)
  1. 我检查了丢失的包裹ldd /opt/XnView/lib/platforms/libqxcb.so | grep "not found"
ldd /opt/XnView/lib/platforms/libqxcb.so  | grep "not found"
    libxcb-icccm.so.4 => not found
    libxcb-image.so.0 => not found
    libxcb-keysyms.so.1 => not found
    libxcb-render-util.so.0 => not found
    libxcb-xkb.so.1 => not found
    libxkbcommon-x11.so.0 => not found
    libxcb-icccm.so.4 => not found
    libxcb-image.so.0 => not found
    libxcb-keysyms.so.1 => not found
    libxcb-render-util.so.0 => not found
    libxcb-xkb.so.1 => not found
    libxkbcommon-x11.so.0 => not found
    libicui18n.so.56 => not found
    libicuuc.so.56 => not found
    libicudata.so.56 => not found
  1. 我安装了缺少的软件包。
sudo apt install libxcb-image0
sudo apt install libxcb-keysyms1
sudo apt install libxcb-render-util0
sudo apt install libxcb-xkb1
sudo apt install libxkbcommon-x11-0

问题解决了。

答案2

我在尝试运行 wireshark 时遇到了这个问题。我用 修复了这个问题xhost +。我不知道为什么现在需要它,但它无法打开 wireshark 显示。

相关内容