1、Qt Widgets Application可执行程序发布方式
首先用 QtCreator 新建一个 Qt Widgets Application 项目,直接用默认的 QMainWindow 程序就可以了,项目名字假定是 hellomw。
然后以 Release 方式编译生成 exe 程序
2、生成的程序运行正常之后,找到项目的生成目录,比如 项目源码路径:
C:\QtPros\helloworld
它的项目生成目录是
C:\QtPros\build-hellomw-Desktop_Qt_5_4_0_MinGW_32bit-Release
进入这个文件夹,在进入它的子文件夹 release 里面,找到 hellomw.exe ,
将这个exe 复制到一个新的单独的文件夹里用于发布,比如存到
D:\helloworld\ 文件夹里面。
(旧,部分情况不可用,出现0xc000007b)
3、然后从开始菜单打开 Qt 命令行,输入命令 :
cd /d D:\hellomw
然后使用 windeployqt 工具命令:
windeployqt axis-tags-example.exe --qmldir D:\Installation\Qt\5.9.2\mingw53_32\qml
(新)
3、打开qt在开始菜单中的终端Qt 5.9.2 for desktop,cd到对应文件夹
windeployqt example.exe --compiler-runtime
windeployqt example.exe
两个都运行。
参考 https://stackoverflow.com/questions/36630830/windeployqt-misses-some-of-the-libraries-and-gets-others-that-are-not-required