EuroAssembler Index Manual Download Source Macros

Sitemap Links Forum Tests Projects


DLL2LIB is convertor which reads dynamically-linked libraries (*.dll ) and creates import libraries (*.lib) from them.

EuroAssembler linker script.
MS Windows 32bit and 64bit.
Dynamic libraries of MS Windows, located as %SystemRoot%\system32\*.dll.
Import libraries written to linkpath directory as ..\objlib\*.lib.
Edit the parameters.
euroasm dll2lib.htm

Before running the script, specify three parameters:

  1. %LibFormat will select preferred import library format.
    Both formats LIBCOF and LIBOMF are accepted by EuroAssembler to declare importable WinAPI function names.
    Filesize of LIBCOF library is smaller, LIBOMF is obsolete.
  2. %Libraries array should enumerate the list of DLL names (without path and extension) from which you want to create import libraries. Those DLLs must be present on your system at link time.
  3. %OutLib declares the file name (without path and extension) of produced import library, for instance %OutLib %SET winapi. Function names exported by all DLL %Libraries will be linked to one big import library ..\objlib\winapi.lib in this case.
    When this %variable is empty (%OutLib %SET ), each DLL listed in %Libraries will create its own import library, for instance ..\objlib\kernel32.lib, ..\objlib\userl32.lib etc.
%LibFormat %SET LIBCOF
%Libraries %SET kernel32, user32, shell32, gdi32, advapi32, comdlg32, comctl32
%OutLib    %SET winapi
The actual linker script:
 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

▲Back to the top▲