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

來源:互聯網
上載者:User

標籤:

 linux Qt5 程式打包

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程式同級目錄

現在你可以雙擊你的程式運行了呵呵

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

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.