Win7 64位系統安裝boost.python時找不到Py_InitModule4的問題

這是由於python27.dll中只有Py_InitModule4_64這個函數。 /python_include_path/modsupport.h文件將Py_InitModule4重命名爲Py_InitModule4_64。python

#if SIZEOF_SIZE_T != SIZEOF_INT
/* On a 64-bit system, rename the Py_InitModule4 so that 2.4
   modules cannot get loaded into a 2.5 interpreter */
#define Py_InitModule4 Py_InitModule4_64
#endif

SIZEOF_SIZE_T及SIZEOF_INT在/python_include_path/pyconfig.h中定義,爲使這二者不一樣,應在文件開頭定義MS_WIN64!函數

相關文章
相關標籤/搜索