know if .lib is static or import

zaharpopov picture zaharpopov · Jun 19, 2011 · Viewed 13k times · Source

I have .lib file compiled from C code. How I know if this self-contained static library or just an import lib and DLL will be needed at runtime? Is there some dumpbin option I'm missing?

Answer

bmargulies picture bmargulies · Jun 19, 2011

Use the lib command. If it's static, lib will show you a pile of .obj files inside. Not so if it's am implib.

lib /list foo.lib

will do it.

Also see:

https://docs.microsoft.com/en-us/cpp/build/reference/managing-a-library