在msys環境下使用: pexports DLL_PATH\DLL_NAME.dll > DLL_PATH\DLL_NAME.def mysql
******* 推薦使用pexports,由於它導出的def是標準的def格式,不須要作任何修改,能夠直接用於生成lib,pexports可在http://sourceforge.net/projects/mingw/files/MinGW/Extension/pexports/下載。sql
在msvc命令控制檯下使用 dumpbin /exports DLL_PATH\DLL_NAME.dll > DLL_PATH\DLL_NAME.def 此文件須要手工修改爲相似的格式:
windows
使用windows程序Dependency Walker 2.2打開,選擇全部函數名後用Save as
編輯成相似上一方法的文件格式ide
lib /def:DLL_PATH\DLL_NAME.def /machine:i386 /OUT:DLL_PATH\DLL_NAME.lib
/machine:i386 部分必須存在,但輸出格式根據你的須要自行查詢幫助文檔獲悉。函數
3.1和3.2功能同樣,在cmd下直接輸reimp有使用幫助提示,dlltool -h,有使用幫助提示this
To avoid installing and fighting against MSYS and Cygwin, you can just extract exported symbols from libvlc.dll to generate a .lib (libvlc.lib) and link your program against it. And all of this using only with Microsoft Visual Studio Tools! In case you don't have Visual Studio you can download the free version here Visual Studio Express. Open a Command Prompt.net
It can be found within the Visual Studio Tools menu entry: Start / Program Files / Microsoft Visual Studio / Visual Studio Tools / Visual Studio Command Prompt.code
Within the command prompt type: dumpbin /exports "C:\Program Files\VideoLAN\VLC\libvlc.dll" > "C:\Program Files\VideoLAN\VLC\libvlc.def" Edit the libvlc.def file and modify it to get something like this: EXPORTS libvlc_add_intf libvlc_audio_get_channel libvlc_audio_get_mute libvlc_audio_get_track libvlc_audio_get_track_count libvlc_audio_get_track_description libvlc_audio_get_volume ... Alternatively, the following command will automatically generate the DEF file: echo EXPORTS > libvlc.def for /f "usebackq tokens=4,* delims=_ " %i in (dumpbin /exports "c:\Program Files\VideoLan\VLC\libvlc.dll"
) do if %i==libvlc echo %i_%j >> libvlc.deftoken
Still within the command prompt type: lib /def:"C:\Program Files\VideoLAN\VLC\libvlc.def" /out:"C:\Program Files\VideoLAN\VLC\libvlc.lib" /machine:x86 Of course, you'll need to adapt the path according to your configuration. Et voila! You have it, now you can link against libvlc.lib in your program :-)ip