您的位置:首页 > 运维架构 > Linux

“Failed to load platform plugin ”xcb“ ” while launching qt5 app on linux without qt installed

2016-01-18 17:09 585 查看
As was posted earlier, you need to make sure you install the platform plugins when you deploy your application. Depending on how you want to deploy things, there are two methods to tell your application where the platform plugins (e.g. platforms/plugins/libqxcb.so)
are at runtime which may work for you.

The first is to export the path to the directory through the QT_QPA_PLATFORM_PLUGIN_PATH variable.
QT_QPA_PLATFORM_PLUGIN_PATH=path/to/plugins ./my_qt_app


or
export QT_QPA_PLATFORM_PLUGIN_PATH=path/to/plugins
./my_qt_app


The other option, which I prefer is to create a qt.conf file in the same directory as your executable. The contents of which would be:
[Paths]
Plugins=/path/to/plugins


More information regarding this can be found here and at
using qt.conf

用这个方法解决了 export QT_ ...
http://stackoverflow.com/questions/17106315/failed-to-load-platform-plugin-xcb-while-launching-qt5-app-on-linux-without
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: