天天看點

This application failed to start because it could not find or load the Qt platform plugin "xcb".

linux系統下Qt5編譯好的程式在未安裝Qt的系統下運作會報以下錯誤:

This application failed to start because it could not find or load the Qt platform plugin "xcb".

Reinstalling the application may fix this problem.

出現這個錯誤,主要是因為qt5為了在多平台下更友善移植,使用了一種新的技術-----platform abstraction system (QPA),而它中的庫又依賴于Qt5中的一個庫檔案libQt5DBus.so.5,是以,隻要打包時隻要加上這個檔案就可以了。

linux下qt5程式打包步驟如下

1、把以下7個庫檔案放到/usr/lib目錄下

    libQt5Widgets.so.5

    libQt5Gui.so.5

    libQt5Core.so.5

    libicui18n.so.51

    libicuuc.so.51

    libicudata.so.51

    libQt5DBus.so.5

2、拷貝Qt5安裝目錄中的platforms目錄,使它和你的Qt程式同級目錄

現在你可以輕按兩下你的程式運作了呵呵

繼續閱讀