When I run lib /list mylib.lib
I see some contained .obj files, but no information about the functions similar to this:
Path\file1.obj
Path\file2.obj
Path\file3.obj
If I open the .lib file as an archieve I can see that there are a number of files 1.txt, ..., n.txt
in addition to the object files. Those txt files seem to contain information about the functions in the .obj files on the format:
:
Path\file1.obj ?function_name@...
:
Thus some info can be retrieved that way.
But isn't there a better way to get the function info ? For example using lib.exe
, dumpbin.exe
or another tool ? Also in a more readable/demangled format ? So far I had no luck finding that.
There is a related question here but it does not discuss what to do with object files contained in a .lib file.
You need to use dumpbin
. (See dumpbin on msdn for more information.)
dumpbin /symbols /exports mylib.lib
You can also use dumpbin
followed by undname
. (See undname.) For example:
dumpbin /all /exports mylib.lib > mylib.txt
undname mylib.txt
Of course you need to do this from a command prompt from which the Visual Studio tools are in your path. With my install dumpbin and undname are at:
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\BIN\amd64\dumpbin.EXE
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\BIN\amd64\undname.EXE
A Visual Studio Command prompt is available from the program menu. But I get one by simply calling
"%VS120COMNTOOLS%..\..\vc\vcvarsall" amd64
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With