[英]Visual Studio - C++ - build and run app as 32bit or 64bit - load DLL from appropripate ProgramFiles dir
[英]Distinguish a 32bit from a 64bit PE object file generated by cl.exe (Visual Studio C++)
給定來自cl.exe
兩個 PE 對象文件,一個 32 位和一個 64 位,如何在不求助於 unix 實用程序的情況下,最好是在命令行(cmd.exe 或 powershell)上區分一個和另一個?
C:\> "...\VC\bin\cl.exe" -c test.c -Fotest32.obj
C:\> "...\VC\bin\x86_amd64\cl.exe" -c test.c -Fotest64.obj
如果我安裝msys2 file
實用程序可以理解它:
$ file test*.obj
test32.obj: Intel 80386 COFF object file, not stripped, 3 sections, [...]
test64.obj: data
file --version
是 5.28,但較新的 5.25 並沒有做得更好。 msys2 不提供objdump.exe
,但當復制到 Linux 時,它可以正確區分這兩個文件:
$ objdump -a test64.obj
test64.obj: file format pe-x86-64
$ objdump -a test32.obj
test32.obj: file format pe-i386
比file
做得更好並且可以通過 msys2 的 pacman 獲得的東西也可能很有趣。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.