我刚刚使用 VS2008 在 64 位 Windows 机器上构建了 libpng。它在\projects\visualc71\Win32_Lib_Release 目录中生成一个 libpng.lib
文件(使用的配置是“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>
但是它没有显示 LIB 文件的架构。如何确定给定的 LIB 文件是为 32 位还是 64 位架构构建的?
最佳答案
使用 dumpbin/headers
机器类型几乎是第一行。
x86 为 14c,x64 为 8664
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
或者
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)
关于windows - 在 Windows 上确定静态库 (LIB) 的 CPU 架构,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3322630/