• Advertisement
Sign in to follow this  

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

This topic is 4466 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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
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?

Share this post


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

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
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]

Share this post


Link to post
Share on other sites
Sorry - my bad - I can't actually see any links with this silly new forum theme, so I didn't notice it.

But, a belated thanks to you anyway [smile], your post at least lead me in the right direction.

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
Sign in to follow this  

  • Advertisement