如何从DLL生成导入库(LIB文件)? [英] How to generate an import library (LIB-file) from a DLL?
本文介绍了如何从DLL生成导入库(LIB文件)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
是否可以从DLL自动生成MSVC导入库(LIB文件)?如何?
Is it possible to autogenerate a MSVC import library (LIB-file) from a DLL? How?
推荐答案
您可以使用dumpbin / exports生成DEF文件 :
dumpbin /exports sqlite3.dll > exports.txt
echo LIBRARY SQLITE3 > sqlite3.def
echo EXPORTS >> sqlite3.def
for /f "skip=19 tokens=4" %A in (exports.txt) do echo %A >> sqlite3.def
图书管理员可以使用此DEF文件生成LIB:
The librarian can use this DEF file to generate the LIB:
lib /def:sqlite3.def /out:sqlite3.lib /machine:x86
所有文件名( exports.txt
, sqlite3.dll
, sqlite3.def
等)应该有完整的路径。
All of the filenames (exports.txt
, sqlite3.dll
, sqlite3.def
, etc.) should be prepended with full paths.
这篇关于如何从DLL生成导入库(LIB文件)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文