Qt - 使用windeployqt發布Qt生成的exe軟件


windeployqt工具作用:  

The Windows deployment tool is designed to automate the process of creating a deployable folder containing the Qt-related dependencies (libraries, QML imports, plugins, and translations) required to run the application from that folder. It creates a sandbox for Windows Runtime or an installation tree for Windows desktop applications, which can be easily bundled into an installation package。

使用方法:

工程名稱“DCP”,為一通信程序,包含第三方庫ControlCAN.dll,以及圖標文件夾;

1,生成exe程序時,選擇“Release”;

2,在項目文件夾中build-DCP-Desktop_Qt_5_7_0_MinGW_32bit-Release把DCP.exe拷貝到其他文件夾中,本次試驗在E盤根目錄創建DCPApp文件夾,將DCP.exe拷貝此文件夾中;

3,打開Qt5.7 for desktop,如下圖:

4,切換到E盤DCPApp文件夾,命令如下:

5,輸入windeployqt DCP.exe,工具自動查找依賴的庫和翻譯文件以及圖標:

6,將第三方庫文件ControlCAN.dll拷貝到DCPApp文件夾中,所有文件如下

7,將DCPApp文件夾拷貝到其他電腦,運行DCP.exe即可實現軟件運行。


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM