![找不到Qt平台插件“wayland”](https://linux22.com/image/176848/%E6%89%BE%E4%B8%8D%E5%88%B0Qt%E5%B9%B3%E5%8F%B0%E6%8F%92%E4%BB%B6%E2%80%9Cwayland%E2%80%9D.png)
运行 vlc 时出现以下错误:
$ vlc
VLC media player 3.0.11 Vetinari (revision 3.0.11-0-gdc0c5ced72)
[0000561d2cc24a30] vlcpulse audio output error: PulseAudio server connection failure: Connection refused
[0000561d2cbf2f50] main interface error: no suitable interface module
[0000561d2cb5a460] main libvlc error: interface "globalhotkeys,none" initialization failed
[0000561d2cb5a460] main libvlc: Running vlc with the default interface. Use 'cvlc' to use vlc without interface.
qt.qpa.plugin: Could not find the Qt platform plugin "wayland" 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: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, xcb.
Aborted (core dumped)
pacman
我已经在 Arch Linux 中安装了 vlc 。我正在尝试运行 vlc,sway
其中有一个wayland
窗口管理器。
设置以下任何环境变量后运行 vlc 都会导致相同的错误。
$ QT_QPT_PLATFORM=wayland vlc
$ QT_QPT_PLATFORM=offscreen vlc
$ QT_PLUGIN_PATH=/usr/lib/qt/plugins/ vlc
此外,卸载 vlc 并使用pacman
( uninstalls and reinstalls qt
)重新安装它并没有解决问题;同样的错误仍然存在。
这是在 QT_DEBUG_PLUGINS 标志打开的情况下运行 vlc 的输出。
$ QT_DEBUG_PLUGINS=1 vlc
VLC media player 3.0.11 Vetinari (revision 3.0.11-0-gdc0c5ced72)
[000055b67a7aea30] vlcpulse audio output error: PulseAudio server connection failure: Connection refused
[000055b67a847f60] main interface error: no suitable interface module
[000055b67a6e4460] main libvlc error: interface "globalhotkeys,none" initialization failed
[000055b67a6e4460] main libvlc: Running vlc with the default interface. Use 'cvlc' to use vlc without interface.
QFactoryLoader::QFactoryLoader() checking directory path "/usr/lib/qt/plugins/platforms" ...
QFactoryLoader::QFactoryLoader() looking at "/usr/lib/qt/plugins/platforms/libqeglfs.so"
Found metadata in lib /usr/lib/qt/plugins/platforms/libqeglfs.so, metadata=
{
"IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
"MetaData": {
"Keys": [
"eglfs"
]
},
"archreq": 0,
"className": "QEglFSIntegrationPlugin",
"debug": false,
"version": 331520
}
Got keys from plugin meta data ("eglfs")
QFactoryLoader::QFactoryLoader() looking at "/usr/lib/qt/plugins/platforms/libqlinuxfb.so"
Found metadata in lib /usr/lib/qt/plugins/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 "/usr/lib/qt/plugins/platforms/libqminimal.so"
Found metadata in lib /usr/lib/qt/plugins/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 "/usr/lib/qt/plugins/platforms/libqminimalegl.so"
Found metadata in lib /usr/lib/qt/plugins/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 "/usr/lib/qt/plugins/platforms/libqoffscreen.so"
Found metadata in lib /usr/lib/qt/plugins/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 "/usr/lib/qt/plugins/platforms/libqvnc.so"
Found metadata in lib /usr/lib/qt/plugins/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 "/usr/lib/qt/plugins/platforms/libqxcb.so"
Found metadata in lib /usr/lib/qt/plugins/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 "/usr/bin/platforms" ...
qt.qpa.plugin: Could not find the Qt platform plugin "wayland" 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: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, xcb.
Aborted (core dumped)
ldd /usr/lib/qt/plugins/platforms/libqxcb.so
这是暗示所有依赖项都已安装的输出。
$ ldd /usr/lib/qt/plugins/platforms/libqxcb.so
linux-vdso.so.1 (0x00007ffc2cbdc000)
libQt5XcbQpa.so.5 => /usr/lib/libQt5XcbQpa.so.5 (0x00007faa3c086000)
libQt5Gui.so.5 => /usr/lib/libQt5Gui.so.5 (0x00007faa3b9b3000)
libQt5Core.so.5 => /usr/lib/libQt5Core.so.5 (0x00007faa3b461000)
libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x00007faa3b284000)
libc.so.6 => /usr/lib/libc.so.6 (0x00007faa3b0bd000)
libfontconfig.so.1 => /usr/lib/libfontconfig.so.1 (0x00007faa3b072000)
libfreetype.so.6 => /usr/lib/libfreetype.so.6 (0x00007faa3af9c000)
libQt5DBus.so.5 => /usr/lib/libQt5DBus.so.5 (0x00007faa3af16000)
libpthread.so.0 => /usr/lib/libpthread.so.0 (0x00007faa3aef4000)
libX11-xcb.so.1 => /usr/lib/libX11-xcb.so.1 (0x00007faa3aeef000)
libxcb-icccm.so.4 => /usr/lib/libxcb-icccm.so.4 (0x00007faa3aee9000)
libxcb-image.so.0 => /usr/lib/libxcb-image.so.0 (0x00007faa3aee3000)
libxcb-shm.so.0 => /usr/lib/libxcb-shm.so.0 (0x00007faa3aedc000)
libxcb-keysyms.so.1 => /usr/lib/libxcb-keysyms.so.1 (0x00007faa3aed7000)
libxcb-randr.so.0 => /usr/lib/libxcb-randr.so.0 (0x00007faa3aec5000)
libxcb-render-util.so.0 => /usr/lib/libxcb-render-util.so.0 (0x00007faa3aebf000)
libxcb-render.so.0 => /usr/lib/libxcb-render.so.0 (0x00007faa3aeaf000)
libxcb-shape.so.0 => /usr/lib/libxcb-shape.so.0 (0x00007faa3aeaa000)
libxcb-sync.so.1 => /usr/lib/libxcb-sync.so.1 (0x00007faa3ae9e000)
libxcb-xfixes.so.0 => /usr/lib/libxcb-xfixes.so.0 (0x00007faa3ae94000)
libxcb-xinerama.so.0 => /usr/lib/libxcb-xinerama.so.0 (0x00007faa3ae8f000)
libxcb-xkb.so.1 => /usr/lib/libxcb-xkb.so.1 (0x00007faa3ae71000)
libxcb-xinput.so.0 => /usr/lib/libxcb-xinput.so.0 (0x00007faa3ae4c000)
libxcb.so.1 => /usr/lib/libxcb.so.1 (0x00007faa3ae22000)
libX11.so.6 => /usr/lib/libX11.so.6 (0x00007faa3acdf000)
libSM.so.6 => /usr/lib/libSM.so.6 (0x00007faa3acd5000)
libICE.so.6 => /usr/lib/libICE.so.6 (0x00007faa3acb8000)
libxkbcommon-x11.so.0 => /usr/lib/libxkbcommon-x11.so.0 (0x00007faa3acae000)
libxkbcommon.so.0 => /usr/lib/libxkbcommon.so.0 (0x00007faa3ac6d000)
libglib-2.0.so.0 => /usr/lib/libglib-2.0.so.0 (0x00007faa3ab44000)
libm.so.6 => /usr/lib/libm.so.6 (0x00007faa3a9fd000)
libgcc_s.so.1 => /usr/lib/libgcc_s.so.1 (0x00007faa3a9e3000)
libGL.so.1 => /usr/lib/libGL.so.1 (0x00007faa3a95d000)
libpng16.so.16 => /usr/lib/libpng16.so.16 (0x00007faa3a923000)
libz.so.1 => /usr/lib/libz.so.1 (0x00007faa3a909000)
libharfbuzz.so.0 => /usr/lib/libharfbuzz.so.0 (0x00007faa3a83a000)
libmd4c.so.0 => /usr/lib/libmd4c.so.0 (0x00007faa3a822000)
libsystemd.so.0 => /usr/lib/libsystemd.so.0 (0x00007faa3a777000)
libdouble-conversion.so.3 => /usr/lib/libdouble-conversion.so.3 (0x00007faa3a760000)
libicui18n.so.67 => /usr/lib/libicui18n.so.67 (0x00007faa3a460000)
libicuuc.so.67 => /usr/lib/libicuuc.so.67 (0x00007faa3a279000)
libdl.so.2 => /usr/lib/libdl.so.2 (0x00007faa3a273000)
libpcre2-16.so.0 => /usr/lib/libpcre2-16.so.0 (0x00007faa3a1e6000)
libzstd.so.1 => /usr/lib/libzstd.so.1 (0x00007faa3a114000)
/usr/lib64/ld-linux-x86-64.so.2 (0x00007faa3c1d8000)
libexpat.so.1 => /usr/lib/libexpat.so.1 (0x00007faa3a0e4000)
libbz2.so.1.0 => /usr/lib/libbz2.so.1.0 (0x00007faa3a0d1000)
libdbus-1.so.3 => /usr/lib/libdbus-1.so.3 (0x00007faa3a07c000)
libxcb-util.so.1 => /usr/lib/libxcb-util.so.1 (0x00007faa3a072000)
libXau.so.6 => /usr/lib/libXau.so.6 (0x00007faa3a06d000)
libXdmcp.so.6 => /usr/lib/libXdmcp.so.6 (0x00007faa3a065000)
libuuid.so.1 => /usr/lib/libuuid.so.1 (0x00007faa3a05c000)
libpcre.so.1 => /usr/lib/libpcre.so.1 (0x00007faa39fea000)
libGLdispatch.so.0 => /usr/lib/libGLdispatch.so.0 (0x00007faa39f31000)
libGLX.so.0 => /usr/lib/libGLX.so.0 (0x00007faa39efe000)
libgraphite2.so.3 => /usr/lib/libgraphite2.so.3 (0x00007faa39ed9000)
librt.so.1 => /usr/lib/librt.so.1 (0x00007faa39ece000)
liblzma.so.5 => /usr/lib/liblzma.so.5 (0x00007faa39ea6000)
liblz4.so.1 => /usr/lib/liblz4.so.1 (0x00007faa39e84000)
libgcrypt.so.20 => /usr/lib/libgcrypt.so.20 (0x00007faa39d61000)
libicudata.so.67 => /usr/lib/libicudata.so.67 (0x00007faa3824a000)
libgpg-error.so.0 => /usr/lib/libgpg-error.so.0 (0x00007faa38223000)
任何帮助是极大的赞赏。
答案1
vlc 是一个 Qt 5 应用程序。根据建筑维基百科,要运行任何 Qt 应用程序,wayland
您需要安装qt5-wayland
或qt6-wayland
使用QT_QPA_PLATFORM=wayland
环境变量来适应 Wayland 应用程序。对于 Wayland 中行为异常的应用程序,请QT_QPA_PLATFORM=xcb
在运行应用程序之前使用。