确定Windows上静态库(LIB)的CPU体系结构

Rei*_*ica 40 windows 64-bit cpu-architecture static-libraries libpng

我刚刚使用VS2008在64位Windows机器上构建了libpng.它libpng.lib在\ projects\visualc71\Win32_Lib_Release目录中生成一个文件(配置使用的是"LIB Release").

我曾经dumpbin检查过这个LIB文件:

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>
Run Code Online (Sandbox Code Playgroud)

但是它没有显示LIB文件的体系结构.如何查找给定的LIB文件是为32位还是64位架构构建的?

Wil*_*ean 57

使用dumpbin/headers

机器类型几乎是您将获得的第一条线.

x86为14c,x64为8664

n:> dumpbin lib642.lib/headers

Microsoft(R)COFF/PE Dumper版本
10.00.30319.01版权所有(C)Microsoft Corporation.版权所有.

转储文件lib642.lib

文件类型:LIBRARY

文件头价值8664机器(x64

要么

n:> dumpbin Lib32.lib/headers

Microsoft(R)COFF/PE Dumper版本
10.00.30319.01版权所有(C)Microsoft Corporation.版权所有.

转储文件Lib32.lib

文件类型:LIBRARY

FILE HEADER VALUES 14C机器(x86)

  • Windows 资源管理器的此属性扩展在不使用工具的情况下显示架构信息:http://sanje2v.wordpress.com/2013/12/10/writing-property-handler-for-windows-explorermanta-property-extension/ (2认同)
  • `dumpbin`命令在[Visual Studio命令提示符]中可用(https://msdn.microsoft.com/en-us/library/ms229859) (2认同)