Friday, January 11, 2008

Def to Lib - VC++ Tips

Def to Lib

Ever had use a third party library and found that the import libraries (.lib) are missing but the export file (.def) is available?

Here is the way to get it.

Use the utility called 'lib.exe', which exists in the following directory:
C:\Program Files\Microsoft Visual Studio\VC98\Bin

The syntax is:
lib.exe /def:exports.def
This will generate your import library (.lib): exports.lib

There is one 'gotcha'; lib.exe requires a dll called MSPDB60.dll. This library appears to missing from the default VC install. However it appears in the following location:
C:\Program Files\Microsoft Visual Studio\COMMON\MSDev98\Bin

Just copy it to the VC98 bin directory and you are all set.

You would think a command like lib /def: is easy to remember; but it isnt.

No comments: