[windows] How to See the Contents of Windows library (*.lib)

I have a binary file - Windows static library (*.lib).
Is there a simple way to find out names of the functions and their interface from that library ?

Something similar to emfar and elfdump utilities (on Linux systems) ?

This question is related to windows static-libraries libraries

The answer is


DUMPBIN /EXPORTS Will get most of that information and hitting MSDN will get the rest.

Get one of the Visual Studio packages; C++


"dumpbin -exports" works for dll, but sometimes may not work for lib. For lib we can use "dumpbin -linkermember" or just "dumpbin -linkermember:1".


Like it can be seen in other answers you'll have to open a Developer Command Prompt offered in your version of Visual Studio to have dumpbin.exe in your execution path. Otherwise, you can set the necessary environment variables by hand.

dumpbin /EXPORTS yourlibrary.lib will usually show just a tiny list of symbols. In many cases, it won't show the functions the library exports.

dumpbin /SYMBOLS /EXPORTS yourlibrary.lib will show that symbols, but also an incredibly huge amount of other symbos. So, you got to filter them, possibly with a pipe to findstr (if you want a MS-Windows tool), or grep.

Searching the Static keyword using one of these tools seems to be a good hint.


LIB.EXE is the librarian for VS

http://msdn.microsoft.com/en-us/library/7ykb2k5f(VS.80).aspx

(like libtool on Unix)


DUMPBIN /EXPORTS Will get most of that information and hitting MSDN will get the rest.

Get one of the Visual Studio packages; C++


1) Open a Developer Command Prompt for VS 2017 (or whatever version you have on your machine)(It should be located under: Start menu --> All programs --> Visual Studio 2017 (or whatever version you have on your machine) --> Visual Studio Tools --> Developer Command Prompt for VS 2017.

2) Enter the following command:

dumpbin /EXPORTS my_lib_name.lib


"dumpbin -exports" works for dll, but sometimes may not work for lib. For lib we can use "dumpbin -linkermember" or just "dumpbin -linkermember:1".


1) Open a Developer Command Prompt for VS 2017 (or whatever version you have on your machine)(It should be located under: Start menu --> All programs --> Visual Studio 2017 (or whatever version you have on your machine) --> Visual Studio Tools --> Developer Command Prompt for VS 2017.

2) Enter the following command:

dumpbin /EXPORTS my_lib_name.lib


Like it can be seen in other answers you'll have to open a Developer Command Prompt offered in your version of Visual Studio to have dumpbin.exe in your execution path. Otherwise, you can set the necessary environment variables by hand.

dumpbin /EXPORTS yourlibrary.lib will usually show just a tiny list of symbols. In many cases, it won't show the functions the library exports.

dumpbin /SYMBOLS /EXPORTS yourlibrary.lib will show that symbols, but also an incredibly huge amount of other symbos. So, you got to filter them, possibly with a pipe to findstr (if you want a MS-Windows tool), or grep.

Searching the Static keyword using one of these tools seems to be a good hint.


Open a visual command console (Visual Studio Command Prompt)

dumpbin /ARCHIVEMEMBERS openssl.x86.lib

or

lib /LIST openssl.x86.lib

or just open it with 7-zip :) its an AR archive


I wanted a tool like ar t libfile.a in unix.
The windows equivalent is lib.exe /list libfile.lib.


LIB.EXE is the librarian for VS

http://msdn.microsoft.com/en-us/library/7ykb2k5f(VS.80).aspx

(like libtool on Unix)


DUMPBIN /EXPORTS Will get most of that information and hitting MSDN will get the rest.

Get one of the Visual Studio packages; C++


Open a visual command console (Visual Studio Command Prompt)

dumpbin /ARCHIVEMEMBERS openssl.x86.lib

or

lib /LIST openssl.x86.lib

or just open it with 7-zip :) its an AR archive


LIB.EXE is the librarian for VS

http://msdn.microsoft.com/en-us/library/7ykb2k5f(VS.80).aspx

(like libtool on Unix)


DUMPBIN /EXPORTS Will get most of that information and hitting MSDN will get the rest.

Get one of the Visual Studio packages; C++


I wanted a tool like ar t libfile.a in unix.
The windows equivalent is lib.exe /list libfile.lib.


LIB.EXE is the librarian for VS

http://msdn.microsoft.com/en-us/library/7ykb2k5f(VS.80).aspx

(like libtool on Unix)


Examples related to windows

"Permission Denied" trying to run Python on Windows 10 A fatal error occurred while creating a TLS client credential. The internal error state is 10013 How to install OpenJDK 11 on Windows? I can't install pyaudio on Windows? How to solve "error: Microsoft Visual C++ 14.0 is required."? git clone: Authentication failed for <URL> How to avoid the "Windows Defender SmartScreen prevented an unrecognized app from starting warning" XCOPY: Overwrite all without prompt in BATCH Laravel 5 show ErrorException file_put_contents failed to open stream: No such file or directory how to open Jupyter notebook in chrome on windows Tensorflow import error: No module named 'tensorflow'

Examples related to static-libraries

"relocation R_X86_64_32S against " linking Error How do I tell CMake to link in a static library in the source directory? File is universal (three slices), but it does not contain a(n) ARMv7-s slice error for static libraries on iOS, anyway to bypass? What's the difference between .so, .la and .a library files? Telling gcc directly to link a library statically static linking only some libraries How to compile a static library in Linux? Difference between static and shared libraries? Trying to include a library, but keep getting 'undefined reference to' messages DLL and LIB files - what and why?

Examples related to libraries

Gradle failed to resolve library in Android Studio Add external libraries to CMakeList.txt c++ The type java.util.Map$Entry cannot be resolved. It is indirectly referenced from required .class files fatal error LNK1104: cannot open file 'kernel32.lib' Node.js Logging The project was not built since its build path is incomplete libstdc++-6.dll not found How to add local jar files to a Maven project? How to add additional libraries to Visual Studio project? Java out.println() how is this possible?