这是由于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!函数