47

I just built libpng on a 64-bit Windows machine using VS2008. It produces a libpng.lib file inside the \projects\visualc71\Win32_Lib_Release directory (Configuration used being "LIB Release").

I used dumpbin to inspect this LIB file:

C:\Temp\libpng-1.4.3>dumpbin projects\visualc71\Win32_LIB_Release\libpng.lib
Microsoft (R) COFF/PE Dumper Version 9.00.30729.01
Copyright (C) Microsoft Corporation.  All rights reserved.


Dump of file projects\visualc71\Win32_LIB_Release\libpng.lib

File Type: LIBRARY

  Summary

         8E4 .debug$S
         DF2 .drectve
        2BCD .rdata
       21165 .text

C:\Temp\libpng-1.4.3>

It does not however show the architecture of the LIB file. How do I find if a given LIB file is built for 32-bit or 64-bit architecture?

Sridhar Ratnakumar
  • 81,433
  • 63
  • 146
  • 187

1 Answers1

68

Use dumpbin /headers

The machine type is almost the first line you'll get.

It will be 14c for x86 and 8664 for x64

n:>dumpbin lib642.lib /headers

Microsoft (R) COFF/PE Dumper Version
10.00.30319.01 Copyright (C) Microsoft Corporation. All rights reserved.

Dump of file lib642.lib

File Type: LIBRARY

FILE HEADER VALUES 8664 machine (x64

Or

n:>dumpbin Lib32.lib /headers

Microsoft (R) COFF/PE Dumper Version
10.00.30319.01 Copyright (C) Microsoft Corporation. All rights reserved.

Dump of file Lib32.lib

File Type: LIBRARY

FILE HEADER VALUES 14C machine (x86)

Will Dean
  • 39,055
  • 11
  • 90
  • 118
  • 2
    This property extension for Windows Explorer shows architecture information without using a tool: http://sanje2v.wordpress.com/2013/12/10/writing-property-handler-for-windows-explorermanta-property-extension/ – Sanjeev Dec 16 '13 at 03:56
  • 7
    The `dumpbin` command is available in a [Visual Studio Command Prompt](https://msdn.microsoft.com/en-us/library/ms229859) – Calin Jul 06 '15 at 12:52