www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Using my .lib files in D

reply Stan Hebben <stanhebben gmail.com> writes:
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
Dec 28 2006
parent reply Daniel Keep <daniel.keep+lists gmail.com> writes:
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
Dec 28 2006
parent reply Stan Hebben <stanhebben gmail.com> writes:
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.
Dec 29 2006
parent BCS <nothing pathlink.com> writes:
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.
Dec 29 2006