QT:5.6.2

操作系统:Windows7

环境:MinGW4.9.2

  1. 配置好环境变量

第一种方法:图形化操作配置

点击我的计算机-》右键属性-》在弹出系统界面选择-》高级系统设置-》点击环境变量-》选择path变量点击编辑-》在变量值的末尾加上” ;F:\qt\QT5\Tools\QtCreator\bin;F:\qt\QT5.6.1_mingw\5.6\mingw49_32\bin\;”(双引号里面的是你的windeployqt.exe存放的路径)

windows中对QT程序进行打包

windows中对QT程序进行打包

windows中对QT程序进行打包

windows中对QT程序进行打包

windows中对QT程序进行打包

第二种方法:

利用cmd命令进行设置

(1)按Win键+R键弹出运行窗口,输入cmd

windows中对QT程序进行打包

(2)在cmd窗口输入

set path=%path%;F:\qt\QT5\Tools\QtCreator\bin;F:\qt\QT5.6.1_mingw\5.6\mingw49_32\bin\;

windows中对QT程序进行打包

(3)回车后就配置好了,可以使用echo %path% 查看path是否添加到环境变量里

windows中对QT程序进行打包

2.在QTcreator打开项目代码,选择左下角构建Release,按下Ctrl+R键运行

windows中对QT程序进行打包

3.找到运行后的Realse版本的exe文件

windows中对QT程序进行打包

4.找一个位置建个空文件夹,我这里在桌面上创建了一个

windows中对QT程序进行打包

5.将上面生成的textfinder.exe文件复制到这个目录下面

windows中对QT程序进行打包

6.在cmd命令窗口进入到该目录下,使用windeployqt textfinder.exe

windows中对QT程序进行打包

7.运行程序

windows中对QT程序进行打包

相关文章: