第一步:打开终端切换到dumpbin所在目录C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\SDK\ScopeCppSDK\VC\bin
C:\Users\lenovo>cd /d C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\SDK\ScopeCppSDK\VC\bin
第二步:执行转换程序,将DLL文件转换为Def文件
dumpbin G:\MesControl.dll /EXPORTS /OUT:G:\MyLib.def
Dump of file G:\MesControl.dll
File Type: DLL
Section contains the following exports for MesControl.dll
00000000 characteristics
FFFFFFFF time date stamp
0.00 version
1 ordinal base
10 number of functions
10 number of names
ordinal hint RVA name
1 0 0000A010 ??0MesControl@@QEAA@XZ = ??0MesControl@@QEAA@XZ (public: __cdecl MesControl::MesControl(void))
2 1 0000A060 ??1MesControl@@QEAA@XZ = ??1MesControl@@QEAA@XZ (public: __cdecl MesControl::~MesControl(void))
Summary
1000 .data
1000 .nep
1000 .pdata
C000 .rdata
1000 .reloc
1000 .rsrc
9000 .text
第三步:按照如下格式裁剪编辑DEF文件
LIBRARY "MyLib"
EXPORTS
??0MesControl@@QEAA@XZ = ??0MesControl@@QEAA@XZ @1
??1MesControl@@QEAA@XZ = ??1MesControl@@QEAA@XZ @2
第四步:执行转换程序,将DEF文件转换为Lib文件
lib /DEF:G:\MyLib.def /MACHINE:X64 /OUT:G:\MyLib.lib
第五步:直接修改DLL文件为MyLIb.DLL