QT /QML程序加载必须dll文件、部署、打包生成免安装程序

qt提供了专门的部署工具, windeployqt

 

QT官方资料显示如下:

Usage: windeployqt [options] [files]
Qt Deploy Tool 5.9.0

The simplest way to use windeployqt is to add the bin directory of your Qt
installation (e.g. <QT_DIR\bin>) to the PATH variable and then run:
  windeployqt <path-to-app-binary>
If ICU, ANGLE, etc. are not in the bin directory, they need to be in the PATH
variable. If your application uses Qt Quick, run:
  windeployqt --qmldir <path-to-app-qml-files> <path-to-app-binary>
 

 

使用步骤:

1-对软件进行Release编译,将生成的exe文件,单独拷贝到特定文件夹。(注意最好不含中文)

2-使用命令行,cd到上述包含exe文件的文件夹。

3-使用windeployqt命令:

     对于Qt-weidget:windeployqt      a.exe   即可

    对于QtQuick(qml):windeployqt  --qmldir     该项目源文件中包含QML文件的地址   a.exe   

           --qmldir 参数 内容是指向项目中qml的文件夹路径, 这样可以让Qt识别运行项目里qml文件需要的QtQuick库.

 

 

 

 

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值