解決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