EuroAssembler Index Manual Download Source Macros


Sitemap Links Forum Tests Projects

dll2lib.htm
Parameters
Script

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

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

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
Script
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
  %ENDIF

▲Back to the top▲