Alex Rivera | Logout

How to make a .lib file when have a .dll file and a header file

Asked 2012-02-20T11:20:06.800
73

I am trying to create an application in visual studio that will be able to access a .dll file that already exists. I need the application to call up routines. I also have a header file that already exists.

I have been researching on the internet and have found that I need to create a .lib file. Looking at similar questions on here I found a link: http://support.microsoft.com/kb/131313 I cannot however follow the directions.

The information in the link says to make a DEF file ( I read elsewhere that this needs to be compiled as a DLL with the same name, but not sure what that name is, the same name as the .dll file?). But I do not understand the first direction, to 'Use DUMPBIN /EXPORTS'. I then need to 'stub out' functions, and then something to do with .OBJ files (I do not know what these files are).

Are there any step-by-step directions, similar to the link above, that are easy to follow?

Edit
Report

1 Answer

23

You can use Digital Mars's IMPLIB tool. It can create a lib file using only the dll, without any need for a .def file.

You can download it at https://ftp.digitalmars.com/bup.zip.

The command line is:

implib.exe /s mydll.lib mydll.dll
answered 2012-02-20T11:36:54.517

Your Answer