Click to See Complete Forum and Search --> : generaing LIB file from DLL


Hernan
May 20th, 1999, 10:35 AM
Hi!

i wrote a DLL in delphi, now, how can i generate a .LIB file from that DLL to be able to use that DLL's export functions from a vc++ application (i want the lib file to compile it with my project).

i've tried:
LIB /def:mydll.dll

but it doesn't work, it generates a LIB file, but not in the right format.
the functions names, aren't there, it also throws warning messages, about it
doesn't understand the MZ mark of the DLL (???)

i also tried IMPLIB from Borland C, but the format of the lib file is different
from the one microsoft uses.

how can i solve this? i have the delphi source code for the DLL, can i tell
delphi to generate the LIB file automatically?

help please, thank you.

Paul McKenzie
May 20th, 1999, 01:08 PM
You used the wrong parameters for the LIB program.
Since you seem to have access to the Borland tools, I would do the following:

Using Borland's IMPDEF.EXE program

IMPDEF MyDLL.DEF MyDLL.DLL

This creates a .DEF file for you. Now you use the LIB command from Microsoft to generate the import library from the .DEF file:

LIB /DEF:MyDLL.DEF

This creates the import library given the .DEF file.

There is a way to create a .DEF file with the Microsoft DUMPBIN program, but a lot of the steps requires editing a new .DEF file "by hand". This is where the Borland IMPDEF program becomes a time-saver.

I haven't done this in a while, but this should work.

Regards,

Paul McKenzie