Sign in to follow this  
Andrew Russell

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

Recommended Posts

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]

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
Quote:
Original post by Andrew Russell
Wow that's expensive!


Ah, but it's magic!


Q: What's DLL to Lib?
A: DLL to Lib is a magical tool which can convert a DLL file into its equivalent static library file.


Funny if this program is only a GUI to some Microsoft commandline tool. :)

Share this post


Link to post
Share on other sites
Well, I doubt that it is (they probably wouldn't be able to redistribute it).

But I'm really tempted to write some software (or even script) that does Q131313 from the MSKB automatically - just to spite them (particularly seeing as they've clogged up the Google results).

Share this post


Link to post
Share on other sites
Quote:
Original post by Andrew Russell
Well, I doubt that it is (they probably wouldn't be able to redistribute it).

But I'm really tempted to write some software (or even script) that does Q131313 from the MSKB automatically - just to spite them (particularly seeing as they've clogged up the Google results).
The third-party tool creates a static lib. implib.exe just creates an import library with stub functions that call the DLL.

You can link with the library you create with implib, but your app will require the DLL. That third-party tool presumably gets around that.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this