Undefined calling conventions in Python.h

Fredrik Lundh fredrik at pythonware.com
Wed Jul 23 13:44:37 CEST 2008


Fredrik Lundh wrote:

>  > cl cl -EHsc -MD -I \python25\include test.cc \python25\libs\python25.lib

cut and paste error there: the "cl cl" should be just one "cl", of course.

and just for the record/google, if I

1) don't include the header file, I get

test.cc(5) : error C3861: 'Py_Initialize': identifier not found, even 
with argument-dependent lookup

2) attempt to undef the __cplusplus macro, I get

test.cc(1) : warning C4117: macro name '__cplusplus' is reserved, 
'#undef' ignored

3) cut and paste declarations from the header files to my own file 
instead of including the files, ignoring the extern "C" part, I get

test.obj : error LNK2019: unresolved external symbol "int __cdecl 
Py_Finalize(void)" (?Py_Finalize@@YAHXZ) referenced in function _main

which looks pretty similar to the errors posted earlier.

</F>




More information about the Python-list mailing list