exe可执行文件依赖dll查找、复制、打包

xiaoxiao2021-02-28  33

首先,打开vs2013工具,

如果查看b.exe中加载了哪些动态库,可以使用:dumpbin /imports b.exe >2.txt

此时exe文件所依赖的dll都会写入2.txt。

将2.txt文件中dll文件名整理,只保留dll文件中,按行存储;

按一下格式写txt,其中,"D:\Opencv 2.4.10\opencv\build\x86\vc12\bin“为dll所在文件夹,C:\Users\Administrator\Desktop\test  为将要打包的文件路径。

@for /f %%i in (2.txt) do if exist "D:\Opencv 2.4.10\opencv\build\x86\vc12\bin\%%i"  copy "D:\Opencv 2.4.10\opencv\build\x86\vc12\bin\%%i"  C:\Users\Administrator\Desktop\test

该格式为bat执行,2.txt中文件被存储到目标文件夹。

文件打包

https://jingyan.baidu.com/article/f71d6037a1102d1ab741d151.html

转载请注明原文地址: https://www.6miu.com/read-2631485.html

最新回复(0)