即使找到了,也无法在“”中加载Qt平台插件“xcb”

bla*_*alb 7 xubuntu dependencies qt

首先我想说,我不是一个经验丰富的 Linux 用户,所以请不要对我太“技术”。
我尝试在 Xubuntu 20.04 上安装XnViewMP包,但收到此错误:

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)
Run Code Online (Sandbox Code Playgroud)

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

bla*_*alb 10

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

  1. 我使用命令将QT_DEBUG_PLUGINS设置为 1 ,并从同一命令行export QT_DEBUG_PLUGINS=1运行xnview 。它返回以下输出:
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)
Run Code Online (Sandbox Code Playgroud)
  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
Run Code Online (Sandbox Code Playgroud)
  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
Run Code Online (Sandbox Code Playgroud)

问题解决了。