来自:http://www.coderetard.com/2009/01/21/generate-a-lib-from-a-dll-with-visual-studio/
工具:VS2010, VLC的libvlc.dll
1. 打开工具 Visual Studio Tools command promopt (Start -> All Programs-> Microsoft Visual Studio 2010 -> Visual Studio Tools -> Visual Studio Command Prompt).
2.生成 .def文件,如果Dll文件已经存在对应的.def文件,这一步可以省略。使用dumpbin命令生成对应的.def文件:dumpbin /exports libvlc.dll,显示如下:
创建一个.def文件(我的是 libvlc.def), 编辑该文件,将上述红框内的函数名复制到该文件中,在首行中添加EXPORTS,如下图:
3.生成.lib。使用 visual studio command prompt命令窗口,执行如下命令:
lib /def:libvlc.def /out:libvlc.lib /machine:x86
lib命令说明:
usage: LIB [options] [files]
options:
/DEF[:filename]
/EXPORT:symbol
/EXTRACT:membername
/INCLUDE:symbol
/LIBPATH:dir
/LIST[:filename]
/MACHINE:{AM33|ARM|EBC|IA64|M32R|MIPS|MIPS16|MIPSFPU|MIPSFPU16|MIPSR41XX|SH3|SH3DSP|SH4|SH5|THUMB|X86}
/NAME:filename
/NODEFAULTLIB[:library]
/NOLOGO
/OUT:filename
/REMOVE:membername
/SUBSYSTEM:{CONSOLE|EFI_APPLICATION|EFI_BOOT_SERVICE_DRIVER|
EFI_ROM|EFI_RUNTIME_DRIVER|NATIVE|POSIX|WINDOWS|
WINDOWSCE}[,#[.##]]
/VERBOSE
来源:oschina
链接:https://my.oschina.net/u/1172521/blog/180109