How to tell if .dll is 32 bits or 64 bits?

Problem

How can one test if a .dll is 32 bits (x86) or 64 bits (x64)?

Solution

Using Dependency Walker:
  1. Download DW from http://www.dependencywalker.com/ (no installation required).
  2. Launch depends.exe, go to File, click Open... and open the desired DLL file.
  3. In the Module section find the Module with the name of the DLL that you opened.
  4. The CPU column tells if the file was compiled for 32 bits or 64 bits.

Example with x64 libmysql.dll:

 

Using dumpbin (Visual Studio Tools):

  1. Start VS2013 x64 Native Tools Command Prompt or VS2013 x86 Native Tools Command Prompt.
  2. Execute dumpbin /headers filename.dll.
  3. Machine is displayed after FILE HEADER VALUES

Example with 32 bit libmysql.dll:

>dumpbin /headers libmysql.dll
...

FILE HEADER VALUES
14C machine (x86)

...