#include<Python.h>: Error in included file
-
I want to run an embedded python script on Qt, but my compiler seem to find a lot of error inside Python.h (more specifically, inside Pyobject.h and sliceobject.h. It might be something called slots, which appeared to be flagged as the Qt slots or it might be a bunch of missing semicolon or parenthesis.
Since these files are from the official python distribution and the include files of the pythonXX.lib library, I would rather not modify them, since this is supposed to be functional.
Would there be a way to prevent my compiler from flagging error within these files?
-
@Factao If the problem is the conflict between Python "slots" and Qt "slots" you can set QT_NO_KEYWORDS (see https://github.com/pytorch/pytorch/issues/19405)
-
@jsulm Thank you!
I am also getting a lot of syntax error in this line:
PyAPI_FUNC(int) PySlice_GetIndices(PyObject *r, Py_ssize_t length, Py_ssize_t *start, Py_ssize_t *stop, Py_ssize_t *step); Py_DEPRECATED(3.7) PyAPI_FUNC(int) PySlice_GetIndicesEx(PyObject *r, Py_ssize_t length, Py_ssize_t *start, Py_ssize_t *stop, Py_ssize_t *step, Py_ssize_t *slicelength);
These are the line 43 to 49 of sliceobject.h. There apparently is a lot of missing parenthesis and semicolon before a 'constant', but there isn't any apparent conflicting keyword.