來自: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). visual-studio
2.生成 .def文件,若是Dll文件已經存在對應的.def文件,這一步能夠省略。使用dumpbin命令生成對應的.def文件:dumpbin /exports libvlc.dll,顯示以下: code
建立一個.def文件(個人是 libvlc.def), 編輯該文件,將上述紅框內的函數名複製到該文件中,在首行中添加EXPORTS,以下圖: it
3.生成.lib。使用 visual studio command prompt命令窗口,執行以下命令: io
lib /def:libvlc.def /out:libvlc.lib /machine:x86 file
lib命令說明: command
usage: LIB [options] [files] im
options: ember
/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