解决qt.qpa.plugin: Could not find the Qt platform plugin “xcb“ in ““


引自:https://blog.csdn.net/u010168781/article/details/89681674

引自:https://blog.csdn.net/sksukai/article/details/107325930

 

思路一.设置环境变量 export QT_DEBUG_PLUGINS=1

加了这个环境变量,看到QT程序加载的过程,看到了详细的报错信息。
最后一部分是这样的:

Found metadata in lib /usr/lib64/qt5/plugins/platforms/libqxcb.so, metadata=
{
    "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
    "MetaData": {
        "Keys": [
            "xcb"
        ]
    },
    "className": "QXcbIntegrationPlugin",
    "debug": false,
    "version": 329218
}
QLibraryPrivate::loadPlugin failed on "/usr/lib64/qt5/plugins/platforms/libqxcb.so" : "Cannot load library /usr/lib64/qt5/plugins/platforms/libqxcb.so: (/lib64/libQt5XcbQpa.so.5: symbol _ZNK11QFontEngine6handleEv, version Qt_5_PRIVATE_API not defined in file libQt5Gui.so.5 with link time reference)"
This application failed to start because it could not find or load the Qt platform plugin "xcb"
in "".

Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, xcb, xcb.

Reinstalling the application may fix this problem.

看到问题没?
libQt5XcbQpa.so.5

libQt5DBus.so.5

libQt5XcbQpa.solibQt5DBus.so.5拷贝到运行目录。ok

可能链接接失效

 

ln -bs libQt5DBus.so.5.14.0 libQt5DBus.so.5

思路二:

将qt下plugins目录下的platforms目录拷贝到可执行目录,和执行程序同一级目录(一定同一级)

思路三:

报错:undefined symbol: FT_Get_Font_Format

解决方法
安装最新的libfreetype
源码下载地址:
http://download.savannah.gnu.org/releases/freetype/
选择最新的版本freetype-2.10.0.tar.bz2: http://download.savannah.gnu.org/releases/freetype/freetype-2.10.0.tar.bz2
拷贝到linux系统中,执行以下步骤,编译、安装freetype-2.10.0

再次运行报错:symbol dbus_message_get_allow_interactive_authorization, version LIBDBUS_1_3 not defined in file libdbus-1.so.3 with link time reference

安装最新的libdbus库
源码下载地址
https://dbus.freedesktop.org/releases/dbus/
选择libdbus.1.13.8下载: https://dbus.freedesktop.org/releases/dbus/dbus-1.13.8.tar.xz
拷贝到linux系统中,执行以下步骤,编译、安装dbus-1.13.8.tar.xz

 

最终问题解决!!!

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM