操作系统: window10
QtCreator 运行后生成.exe文件不能在没有配置Qt环境的运行,需要打包一些依赖的库文件
1、查找依赖库
1.1 qt 自带工具windeployqt,复制依赖动态库dll到exe相同的文件夹,但是依赖的opencv库没有复制过去
windeployqt test.exe
1.2 使用hap-depends,用来可看DLL或EXE的导入和导出函数, 只能查看依赖,需要手动复制。
推荐windeployqt 查找依赖库 + 手动复制opencv4.4.0/lib下的dll
2、使用工具Enigma Virtual Box进行打包,生成最终的.exe文件
2.1 设置输入文件
2.1 设置输出文件
2.3 Files Options 勾选Compress Files
2.4 Add Folder Recursive 添加依赖的库文件夹,不需要包括原始exe
2.5 Process 生成打包后exe
附注:
开始时使用Qt 5.14.0 windeployqt 工具 提示 unable to find the platform plugin
更新Qt 5.14.1正常