2015-11-13 87 views

回答

4

嘗試dumpbin /headers "libpython27.a"。 (dumpbin reference

輸出將包含

FILE HEADER VALUES 14C machine (x86)

FILE HEADER VALUES 8664 machine (x64)


請注意,如果你得到這樣的錯誤信息:

E:\temp>dumpbin /headers "libpython27.a" 
LINK: extra operand `libpython27.a' 
Try `LINK --help' for more information. 

這意味着在搜索路徑中有一處GNU鏈接實用程序的副本。確保您使用正確的link.exe(例如C:\Program Files (x86)\Common Files\Microsoft\Visual C++ for Python\9.0\VC\bin中提供的那個)。這還需要mspdb80.dll,這是在同一個文件夾或東西在PATH,否則你會得到錯誤消息:

enter image description here

2

當開始在終端/命令行Python解釋還可以看到這樣一行:

的Python 2.7.2(默認情況下,2011年6月12日,14點24分46秒)[MSC訴1500 64位 (AMD64)] on win32

其中[MSC v.1500 64位(AMD64)]表示64位Python。

或者

嘗試使用ctypes的獲得一個空指針的大小:

import ctypes 
print ctypes.sizeof(ctypes.c_voidp) 

這將是4爲64位32位或8。

0

在Linux上,你可以使用:objdump -a libpython27.a|grep 'file format'

實施例:

[email protected]:/media/code$ objdump -a libpython27.a|grep 'file format' 
dywkt.o:  file format pe-i386 
dywkh.o:  file format pe-i386 
dywks01051.o:  file format pe-i386 
dywks01050.o:  file format pe-i386 
dywks01049.o:  file format pe-i386 
dywks01048.o:  file format pe-i386 
[...] 
相關問題