How to tell if a lib is a static lib or a dynamic lib?

A lib file name typically ends with .a or .lib. A .a suffix lib is a static lib but a .lib suffix lib is either a static lib or an import lib of a dynamic library. How to check if a .lib library is static or dynamic?

Use the lib tool which is accompanied by Visual Studio. Open a command prompt for Visual Studio and run:

lib /list yourlibfile.lib

If it outputs a list of .o files(object files), you can know yourlibfile.lib is a static lib. If it outputs a list of .dll files, you can tell yourlibfile.lib is a dynamic lib.

Use the dumpin tools

dumpbin -all yourlibfile.lib > yourlibfile.txt

findstr “Archive member name” yourlibfile.txt

If it shows .dll files, yourlibfile.lib is a dynamic lib. If it shows .o files, yourlibfile.lib is a static lib.

Did you like this?
Tip admin with Cryptocurrency

Donate Bitcoin to admin

Scan to Donate Bitcoin to admin
Scan the QR code or copy the address below into your wallet to send some bitcoin:

Donate Bitcoin Cash to admin

Scan to Donate Bitcoin Cash to admin
Scan the QR code or copy the address below into your wallet to send bitcoin:

Donate Ethereum to admin

Scan to Donate Ethereum to admin
Scan the QR code or copy the address below into your wallet to send some Ether:

Donate Litecoin to admin

Scan to Donate Litecoin to admin
Scan the QR code or copy the address below into your wallet to send some Litecoin:

Donate Monero to admin

Scan to Donate Monero to admin
Scan the QR code or copy the address below into your wallet to send some Monero:

Donate ZCash to admin

Scan to Donate ZCash to admin
Scan the QR code or copy the address below into your wallet to send some ZCash:

Leave a Reply