python无法编译为.pyd fi

2024-09-28 17:15:23 发布

您现在位置:Python中文网/ 问答频道 /正文

cl /LD hellomodule.c /Fe_hellomodule.pyd -IC:\Users\Andy\AppData\Local\Programs\Python\Python35-32\include C:\Users\Andy\AppData\Local\Programs\Python\Python35-32\libs\python35.lib

我在visual studio 2015命令提示符中运行了上述命令,返回了一个错误:

   Creating library _hellomodule.lib and object _hellomodule.exp
hellomodule.obj : error LNK2019: unresolved external symbol _PyInt_Check referenced in function _say_hello
hellomodule.obj : error LNK2019: unresolved external symbol _PyInt_AsLong referenced in function _say_hello
hellomodule.obj : error LNK2019: unresolved external symbol _Py_InitModule referenced in function _inithello
_hellomodule.pyd : fatal error LNK1120: 3 unresolved externals

任何人都知道怎么做,谢谢。你知道吗


Tags: inobjlocalfunctionerrorsymbolusersappdata