Results 1 to 4 of 4

Thread: Creating .lib file from a Dll

  1. #1

    Creating .lib file from a Dll

    Assuming you want to integrate a Dll in a language like C++, you will need to create a .lib file for the linker to know how to call the exported functions. The calling convention can be STDCALL or CDECL (which is somewhat standard).

    There are several techniques to accomplish this and before I write my own I thought I would see if anyone has been down this road before.

  2. #2

    Re: Creating .lib file from a Dll

    if you mean how to convert dll to lib ; before several weeks i have converted a dll to a lib like this:
    polib libgmp-3.dll /machine:ix86 /out:libgmp-3.lib

    polib.exe is the pelles library manager, pelles c is a freeware development kit for Windows : http://www.smorgasbordet.com/pellesc/
    i have found this file "polib.exe" in the folders of many programming languages.

    there is also another older method, if i remebmer it i will post it.

    regards

  3. #3

    Re: Creating .lib file from a Dll

    Yes Pelle's excellent polib is probably the best choice once the .Def file is made. I guess I will just have to write this part (extracting the functions from the PE header) and then shell to polib.

  4. #4

    Re: Creating .lib file from a Dll

    i haven't used a DEF file, i have just tried it with the above dll.
    anyway there is a very old file called:
    Borland Impdef Version 3.0.1 (c) 1991, 1998
    i have attached it, for making the DEF file write:
    impdef.exe libgmp-3.dll.def libgmp-3.dll
    then using the LIB.exe from VC++6.0; or Open Watcom C/C++ LIB:
    LIB /def:LIBGMP-3.dll.def /out:LIBGMP-3.LIB
    i have just tried it successfully.
    i can't determine if those old utilities are successfull with the modern dlls made by visual studio 2005-2008 or not, but it is successfull with the modern libgmp-3.dll made this year.
    Attached Files Attached Files

Similar Threads

  1. creating a shape
    By hendryawan in forum UI (User Interface)
    Replies: 19
    Last Post: 22-02-2011, 11:40

Posting Permissions

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