www.digitalmars.com [Home] [Search] [CTG] [RTL] [IDDE]

Last update Aug 16, 2002


IMPLIB

Build an Import Library

An import library is necessary when calling functions in a DLL; it provides the stubs that hook up to the DLL at runtime. IMPLIB is used to create import libraries. It uses as input either the DLL itself or a module definition (.def) file.

IMPLIB commands have the following format:

	implib [switches] libfile [ dllfile | deffile ]
Either a dllfile or deffile must be given (but not both). IMPLIB reads the file, and uses the export records in it to create an import library libfile. libfile is then linked in with your application.

To create the import library kernel32.lib from the NT system dll kernel32.dll:

	implib /s kernel32.lib kernel32.dll
Module definition files are in the same format as that used to create the DLL.

COFF2OMF

Convert Object and Lib Files to OMF

Digital Mars tools all work with the Intel 32 bit OMF object and library file format. Microsoft's 32 bit tools work with Microsoft's own variant of the COFF format. Many such COFF format files can be converted to OMF with the coff2omf program:
	coff2omf inputfiles...
	
The input files can be either object files (.obj) or library files (.lib). They are converted in place to OMF.

For example, to convert user32.lib from COFF to OMF:

	coff2omf user32.lib
	
The Microsoft COFF format apparently changed with Visual C++ 6.0. To use coff2omf on a .lib file with the newer format, use Microsoft's linker to convert the file to the earlier COFF format:
	link /lib /convert file.lib
	
and then use coff2omf on it.
Copyright © 1995-2002 Digital Mars. All Rights Reserved.