Create a .lib from a DLL (VC2005e) - SOLVED

Started by
12 comments, last by johnhattan 18 years, 4 months ago
I need a quick way of extract the exports of a DLL to a .lib file. Is there a way of doing this for (in?) MSVC 2005 Express? I know it's possible - BCB3 used to do this (necessary, because it's .lib format was different to Microsoft's). Indeed, I'm compiling some of my old code from the Borland era, and I back then I did it to get Borland-friendly library files. But since the I've lost the Microsoft versions of the library files - which I now must recreate (obviously, I still have the DLLs). Also - if 2005 express can't do it - I've got 2003 (standard and toolkit) available if they can. [Edited by - Andrew Russell on November 29, 2005 7:32:59 AM]
Advertisement
using "lib /def:foo.dll" appears to do something useful (creates a .lib and .exp file for the DLL). The documentation is very sketchy about what this is actually doing - can anyone shed some light on this?
I googled and found this piece of third party software.

Clucker
Wow that's expensive!
Yeah, but there is a free trial. They're always good. But you're right.

Dave
Perhaps this will help. It looks like you need to (by hand) produce a .def file for the DLL, and then from that create the .lib.
OK, well it turns out that the "lib /def:foo.dll" command dosn't do anything useful (or I'm using it incorrectly). At least - I get unresolved externals, despite using the fancy new libraries it generates. Shame - it seemed promising.


Quote:Original post by bakery2k1
Perhaps this will help. It looks like you need to (by hand) produce a .def file for the DLL, and then from that create the .lib.

Do you have any more information on how to go about this? From my (very) limited knowledge of .def files, they're just a list of functions right? Functions which I can eaisly see are missing from the unresolved-externals list?
I found this link into the Microsoft KB. It seems to be exactly what I want.

I'll try it and report back [smile]
Yep, the instructions in that KB article worked beautifully. Thanks everyone.
Quote:Original post by Andrew Russell
I found this link into the Microsoft KB. It seems to be exactly what I want.


That's the same page I gave you! [smile]

This topic is closed to new replies.

Advertisement