Could not find or load the Qt platform plugin “xcb” on Archlinux (Write! AppImage)

隐身守侯 提交于 2019-12-11 01:31:11

问题


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)

While running with 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)

Any help would be appreciated.


回答1:


I think the problem is related to this error:

/usr/lib/libfontconfig.so.1: undefined symbol: FT_Done_MM_Var

You should upgrade your fontconfig library. Try with version 2.13.




回答2:


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.

  • 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.

  • Use ldd -v /path/to/your/app to find and resolve issues with missing libs.

  • Set environment vars: 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



来源:https://stackoverflow.com/questions/53752917/could-not-find-or-load-the-qt-platform-plugin-xcb-on-archlinux-write-appimag

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!