Have a static lib, is there a simple way to know it is for 32 bit or 64 bit?
Asked Answered
R

4

71

Is there any tool that can directly test if a library is made for 32 or 64 bit?

Raleigh answered 16/5, 2011 at 7:3 Comment(0)
L
65

You can use dumpbin utility with /headers option

It returns whether the library was built for 32 or 64 bit architecture.

Check DUMPBIN Reference for details.

Example usage:

c:\>dumpbin libXYZ.lib /headers
Lengthen answered 16/5, 2011 at 7:12 Comment(1)
this does it, look for the 'FILE HEADERS' sectionOpisthognathous
D
69

Run a visual studio command prompt to ensure your path can find dumpbin.exe

Pipe to findstr to save on the big spew about each section and optionally you can use a wildcard to analyse a folder of libs.

dumpbin /headers *.lib | findstr machine

Example of what you're looking for;

8664 machine (x64)
Daniels answered 27/5, 2014 at 9:44 Comment(0)
L
65

You can use dumpbin utility with /headers option

It returns whether the library was built for 32 or 64 bit architecture.

Check DUMPBIN Reference for details.

Example usage:

c:\>dumpbin libXYZ.lib /headers
Lengthen answered 16/5, 2011 at 7:12 Comment(1)
this does it, look for the 'FILE HEADERS' sectionOpisthognathous
C
0

I haven't tried this but you can also use file.exe, the unix file equivalent on windows. You can download the binary (and source as well) from here or gnu version here

Cloudburst answered 16/5, 2011 at 7:33 Comment(1)
That's just the standard GNU File tool, right? I have tried this with file from a recent version of MinGW from Git for Windows, and it says current ar archive for the x64 python36.lib distributed with Python 3.6 (Windows).Broida
T
-1

In visual studio, we can get to know about whether Lib/dll is 32 or 64 bit with Coreflags.exe This tool is automatically installed with Visual Studio. we can run this command from Command line, which can be run as

 C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin\CorFlags.exe whatever_Lib_with_path

This command will return you whether that file is managed or Unmanaged. If its managed then it can give info about that is is 32/64 bit.

Tetrastich answered 21/2, 2017 at 8:4 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.