无法找到或加载 Qt 平台插件“xcb"在 Archlinux 上(写!AppImage) [英] Could not find or load the Qt platform plugin "xcb" on Archlinux (Write! AppImage)
问题描述
尝试安装 Write!安装了 qt5、freetype2 2.9.1 和 fontconfig 2:2.13.1+12+g5f5ec56-1 的 Arch Linux 上的 AppImage
Trying to install the Write! AppImage on Arch Linux with qt5 installed, freetype2 2.9.1 and fontconfig 2:2.13.1+12+g5f5ec56-1
[levi@astize Write!]$ ./write
This application failed to start because it could not find or load the Qt platform plugin "xcb"
in "".
Available platform plugins are: xcb.
Reinstalling the application may fix this problem.
Aborted (core dumped)
使用QT_DEBUG_PLUGINS=1
运行时
[levi@astize Write!]$ ./write
QFactoryLoader::QFactoryLoader() checking directory path "/tmp/.mount_unuY6s/usr/plugins/platforms" ...
QFactoryLoader::QFactoryLoader() looking at "/tmp/.mount_unuY6s/usr/plugins/platforms/libqxcb.so"
Found metadata in lib /tmp/.mount_unuY6s/usr/plugins/platforms/libqxcb.so, metadata=
{
"IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
"MetaData": {
"Keys": [
"xcb"
]
},
"className": "QXcbIntegrationPlugin",
"debug": false,
"version": 329989
}
Got keys from plugin meta data ("xcb")
QFactoryLoader::QFactoryLoader() checking directory path "/tmp/.mount_unuY6s/usr/bin/platforms" ...
Cannot load library /tmp/.mount_unuY6s/usr/plugins/platforms/libqxcb.so: (/usr/lib/libfontconfig.so.1: undefined symbol: FT_Done_MM_Var)
QLibraryPrivate::loadPlugin failed on "/tmp/.mount_unuY6s/usr/plugins/platforms/libqxcb.so" : "Cannot load library /tmp/.mount_unuY6s/usr/plugins/platforms/libqxcb.so: (/usr/lib/libfontconfig.so.1: undefined symbol: FT_Done_MM_Var)"
This application failed to start because it could not find or load the Qt platform plugin "xcb"
in "".
Available platform plugins are: xcb.
Reinstalling the application may fix this problem.
Aborted (core dumped)
任何帮助将不胜感激.
推荐答案
在 Qt 中编译 C++ 应用程序并将其部署到生产机器后,我一直在努力解决这个错误.以下是我为解决此问题而采取的一些措施.
I was struggling with this error after compiling a c++ app in Qt and deploying it to a production machine. Here are some things I did to resolve the issue.
安装 Qt 库.我的安装在我的开发机器上的
~/Qt/5.9.8/gcc_64/lib/
中.我只是把这个目录复制到生产机器上.
Install the Qt libs. Mine were installed in
~/Qt/5.9.8/gcc_64/lib/
on my dev machine. I simply copied this directory to the production machine.
使用 ldd -v/path/to/your/app
查找和解决缺少库的问题.
Use ldd -v /path/to/your/app
to find and resolve issues with missing libs.
设置环境变量:LD_LIBRARY_PATH=~/Qt/5.9.8/gcc_64/lib/:/path/to/any/custom/libs/for/your/app
QT_PLUGIN_PATH=/usr/lib/x86_64-linux-gnu/qt5/plugins
这篇关于无法找到或加载 Qt 平台插件“xcb"在 Archlinux 上(写!AppImage)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!