CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 1999
    Posts
    3

    generaing LIB file from DLL

    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.





  2. #2
    Join Date
    Apr 1999
    Posts
    27,449

    Re: generaing LIB file from DLL

    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



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured