确定 Windows 上静态库 (LIB) 的 CPU 体系结构 [英] Determining the CPU architecture of a static library (LIB) on Windows

查看:31
本文介绍了确定 Windows 上静态库 (LIB) 的 CPU 体系结构的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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

我使用 dumpbin 来检查这个 LIB 文件:

I used dumpbin to inspect this LIB file:

C:Templibpng-1.4.3>dumpbin projectsvisualc71Win32_LIB_Releaselibpng.lib
Microsoft (R) COFF/PE Dumper Version 9.00.30729.01
Copyright (C) Microsoft Corporation.  All rights reserved.


Dump of file projectsvisualc71Win32_LIB_Releaselibpng.lib

File Type: LIBRARY

  Summary

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

C:Templibpng-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/headers

Use dumpbin /headers

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

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

x86 为 14c,x64 为 8664

It will be 14c for x86 and 8664 for x64

n:>dumpbin lib642.lib/headers

n:>dumpbin lib642.lib /headers

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

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

文件 lib642.lib 的转储

Dump of file lib642.lib

文件类型:图书馆

文件头值8664 机器 (x64

FILE HEADER VALUES 8664 machine (x64

或者

n:>dumpbin Lib32.lib/headers

n:>dumpbin Lib32.lib /headers

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

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

转储文件 Lib32.lib

Dump of file Lib32.lib

文件类型:图书馆

文件头值14C机(x86)

FILE HEADER VALUES 14C machine (x86)

这篇关于确定 Windows 上静态库 (LIB) 的 CPU 体系结构的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆