DLL2LIB is convertor which reads dynamically-linked libraries (*.dll
) and creates import libraries
(*.lib
) from them.
%SystemRoot%\system32\*.dll.
..\objlib\*.lib.
euroasm dll2lib.htm
Before running the script, specify three parameters:
%OutLib %SET winapi
. Function names exported by all DLL %Libraries
will be linked to one big import library ..\objlib\winapi.libin this case.
%OutLib %SET
), each DLL listed in %Libraries will create its own import library, for instance
..\objlib\kernel32.lib,
..\objlib\userl32.libetc.
%LibFormat %SET LIBCOF %Libraries %SET kernel32, user32, shell32, gdi32, advapi32, comdlg32, comctl32 %OutLib %SET winapi
EUROASM ListRepeat=off, ListVar=off %SystemRoot %SETE SystemRoot ; Get the path to DLL files on this Windows installation. %IF "%OutLib" === "" ; If we want a separated import library from each DLL. lib %FOR %Libraries %lib PROGRAM Format=%LibFormat, OutFile="..\objlib\%lib.lib", ListMap=off, ListGlobals=off LINK "%SystemRoot\system32\%lib.dll" ENDPROGRAM %lib %ENDFOR lib %ELSE ; If we want a bulk version from all DLLs. %OutLib PROGRAM Format=%LibFormat, OutFile="..\objlib\%OutLib.lib", ListMap=off, ListGlobals=off lib %FOR %Libraries LINK "%SystemRoot\system32\%lib.dll" %ENDFOR lib ENDPROGRAM %OutLib %ENDIF