Using my .lib files in D

Daniel Keep daniel.keep+lists at gmail.com
Thu Dec 28 22:29:46 PST 2006


Stan Hebben wrote:
> Hello,
> 
> When I try to use my .lib files in D, the linker doesn't recognize the format.
> (the lib files start with <arch>)
> 
> Is there a way to convert my libraries to a format which the D linker recognizes?
> 
> Thanks
> 
> Stan

I'm assuming you're on Windows.

The problem is that a lot of the .LIB files out there are for MSVC, 
which uses the COFF format for static libraries.  DMD supports OMF.

If the library is JUST an import library (ie: for using a DLL), then 
there are a few tools available to either try and convert the .LIB file, 
or generate a .DEF file as an alternative.

You can get implib (to CREATE an import library from a DLL) as part of 
the Basic Utilities pack for DMC (http://ftp.digitalmars.com/bup.zip, 
linked from http://www.digitalmars.com/download/freecompiler.html).

If you're looking to use something more substantial, you can try 
coff2omf, which is part of the extended utilities package: 
http://www.digitalmars.com/eup.html

Hope this helps.

	-- Daniel


More information about the Digitalmars-d-learn mailing list