Thread overview
Using my .lib files in D
Dec 28, 2006
Stan Hebben
Dec 29, 2006
Daniel Keep
Dec 29, 2006
Stan Hebben
Dec 29, 2006
BCS
December 28, 2006
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
December 29, 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
December 29, 2006
I recompiled some of my libraries to OMF, and some are import libraries, but that doesn't cover everything.

Unfortunately, the extended utitilies package is not for free.
December 29, 2006
Stan Hebben wrote:
> I recompiled some of my libraries to OMF, and some are import libraries, but that
> doesn't cover everything.

if you have source, try re compiling with dmc (the c/c++ compiler available on digitalmars.com)

BTW, D wont link with C++, only with C.

> 
> Unfortunately, the extended utitilies package is not for free.