windows - 在 Windows 上确定静态库 (LIB) 的 CPU 架构

标签 windows 64-bit static-libraries cpu-architecture libpng

我刚刚使用 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/

相关文章:

python - 如何跨驱动器使用只读文件 `shutil.move`

c++ - 仅当从我的程序打开 CMD 时出现奇怪的 CMD 错误

c# - Windows 10 崩溃侦探

c++ - 尝试创建共享库时出现 C/C++ 错误。制作库的静态版本时不会出现错误

c++ - Visual Studio 2012 Update 4 不会为静态库创建 PDB

c++ - 在 Windows 上为可移植程序使用 Opencv、Mingw 和静态库时出错

windows - 批处理文件 : Escape questionmark in for loop

Java符号查找错误:/usr/lib64/jvm/java-11-openjdk-11/lib/libnio.所以: undefined symbol :initInetAddressIDs

.NET AnyCPU 项目链接平台特定库

visual-studio-2010 - 调试在64位计算机上捕获的32位进程的转储