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

2023-09-07 23:06:08 作者:少女与猫。

我刚刚建立的libpng使用VS2008在64位Windows计算机上。它产生一个 libpng.lib 文件中的\项目\ visualc71 \ Win32_Lib_Release目录(配置为使用LIB发行)。

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").

我用 DUMPBIN 来检查这个LIB文件:

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>

但是,它没有显示出LIB文件的体系结构。如何找到一个给定的LIB文件是专为32位或64位的架构?

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?

推荐答案

使用DUMPBIN /头

Use dumpbin /headers

本机型几乎与第一线,你会得到。

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

这将是14C ​​x86和8664用于基于x64

It will be 14c for x86 and 8664 for x64

N:> DUMPBIN lib642.lib /头

n:>dumpbin lib642.lib /headers

微软(R)COFF / PE自卸车版本   10.00.30319.01版权所有(C)微软公司。保留所有权利。

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

转储文件lib642.lib的

Dump of file lib642.lib

文件类型:LIBRARY

File Type: LIBRARY

文件头值               8664机(64

FILE HEADER VALUES 8664 machine (x64

N:> DUMPBIN Lib32.lib /头

n:>dumpbin Lib32.lib /headers

微软(R)COFF / PE自卸车版本   10.00.30319.01版权所有(C)微软公司。保留所有权利。

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

转储文件Lib32.lib的

Dump of file Lib32.lib

文件类型:LIBRARY

File Type: LIBRARY

文件头值                14C机(86)

FILE HEADER VALUES 14C machine (x86)