New submission from Barry Alan Scott <[email protected]>:
When using the limited API PyCMethod_New is not defined in python3.lib.
This leads to a link error.
This error is in 3.9 and 3.10a5
Discovered when I improved the PyCXX test suite.
Example output:
Link obj\simple.pyd
cl /nologo /W4 /LD /Zi /MT /EHsc /Zi /MT /EHsc -I. -ISrc
-IC:\Python310.win64\include -D_CRT_NONSTDC_NO_DEPRECATE -U_DEBUG -DNDEBUG
-DPy_LIMITED_API=0x3090000 /Feobj\simple.pyd /Fdobj\simple.pdf obj\simple.obj
obj\cxxsupport.obj obj\cxx_extensions.obj obj\cxx_exceptions.obj
obj\cxxextensions.obj obj\IndirectPythonInterface.obj
C:\Python310.win64\libs\python3.lib
Creating library obj\simple.lib and object obj\simple.exp
simple.obj : error LNK2019: unresolved external symbol __imp_PyCMethod_New
referenced in function "protected: virtual class Py::Object __cdecl
Py::PythonExtension<class old_style_class>::getattr_methods(char const *)"
(?getattr_methods@?$PythonExtension@Vold_style_class@@@Py@@MEAA?AVObject@2@PEBD@Z)
obj\simple.pyd : fatal error LNK1120: 1 unresolved externals
NMAKE : fatal error U1077: '"c:\Program Files (x86)\Microsoft Visual
Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\HostX64\x64\cl.EXE"' :
return code '0x2'
Stop.
----------
messages: 386595
nosy: barry-scott
priority: normal
severity: normal
status: open
title: PyCMethod_New not defined in python3.lib
versions: Python 3.10, Python 3.9
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue43155>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com