Sep-05-2017, 11:36 PM
I am attempting to call some CPP code from Python2.7. There is an example of this located inside the Python directory (C:\Python27\Demo\embed). When I attempt to use the makefile (using Cygwin) in that folder I am unable to build. I have not modified the makefile yet and unsure what to edit if I am using gcc as my compiler and dont know if I should change the blddir.
Here are the errors I am getting:
../../Include/pyport.h:886:2: error: #error "LONG_BIT definition appears wrong for platform (bad gcc/glibc config?)."
#error "LONG_BIT definition appears wrong for platform (bad gcc/glibc config?)."
In file included from ../../Include/Python.h:86:0,
from demo.c:3:
../../Include/intobject.h:46:35: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘PyInt_AsUnsignedLongLongMask’
PyAPI_FUNC(unsigned PY_LONG_LONG) PyInt_AsUnsignedLongLongMask(PyObject *);
../../Include/pyconfig.h:302:23: error: unknown type name ‘__int64’
# define PY_LONG_LONG __int64
In file included from ../../Include/Python.h:88:0,
from demo.c:3:
../../Include/longobject.h:53:35: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘PyLong_AsUnsignedLongLong’
PyAPI_FUNC(unsigned PY_LONG_LONG) PyLong_AsUnsignedLongLong(PyObject *);
^
../../Include/longobject.h:54:35: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘PyLong_AsUnsignedLongLongMask’
PyAPI_FUNC(unsigned PY_LONG_LONG) PyLong_AsUnsignedLongLongMask(PyObject *);
^
In file included from ../../Include/Python.h:58:0,
from demo.c:3:
../../Include/pyconfig.h:302:23: error: unknown type name ‘__int64’
# define PY_LONG_LONG __int64
Please let me know if you have any advice for me!
Here are the errors I am getting:
../../Include/pyport.h:886:2: error: #error "LONG_BIT definition appears wrong for platform (bad gcc/glibc config?)."
#error "LONG_BIT definition appears wrong for platform (bad gcc/glibc config?)."
In file included from ../../Include/Python.h:86:0,
from demo.c:3:
../../Include/intobject.h:46:35: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘PyInt_AsUnsignedLongLongMask’
PyAPI_FUNC(unsigned PY_LONG_LONG) PyInt_AsUnsignedLongLongMask(PyObject *);
../../Include/pyconfig.h:302:23: error: unknown type name ‘__int64’
# define PY_LONG_LONG __int64
In file included from ../../Include/Python.h:88:0,
from demo.c:3:
../../Include/longobject.h:53:35: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘PyLong_AsUnsignedLongLong’
PyAPI_FUNC(unsigned PY_LONG_LONG) PyLong_AsUnsignedLongLong(PyObject *);
^
../../Include/longobject.h:54:35: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘PyLong_AsUnsignedLongLongMask’
PyAPI_FUNC(unsigned PY_LONG_LONG) PyLong_AsUnsignedLongLongMask(PyObject *);
^
In file included from ../../Include/Python.h:58:0,
from demo.c:3:
../../Include/pyconfig.h:302:23: error: unknown type name ‘__int64’
# define PY_LONG_LONG __int64
Please let me know if you have any advice for me!