I'm trying to compile a Cython3 file into an executable using GCC. For the moment I'm still stuck with a simple "hello world" :
# -*- coding: utf-8 -*-
if __name__ == "__main__":
print("Hello World !")
Here is the command I've tried to execute in order to compile this simple program :
cython3 test.pyx
gcc -I/usr/include/python3.4 test.c
The first command run correctly, but here is what I get when I type the second one :
cython.c:422:14: error: conflicting types for ‘PyTypeObject’
typedef void PyTypeObject;
^
In file included from /usr/include/python3.4/pytime.h:6:0,
from /usr/include/python3.4/Python.h:65,
from cython.c:16:
/usr/include/python3.4/object.h:422:3: note: previous declaration of ‘PyTypeObject’ was here
} PyTypeObject;
^
cython.c: In function ‘__Pyx_PyObject_GetAttrStr’:
cython.c:488:18: warning: dereferencing ‘void *’ pointer
if (likely(tp->tp_getattro))
^
cython.c:399:43: note: in definition of macro ‘likely’
#define likely(x) __builtin_expect(!!(x), 1)
^
cython.c:488:18: error: request for member ‘tp_getattro’ in something not a structure or union
if (likely(tp->tp_getattro))
^
cython.c:399:43: note: in definition of macro ‘likely’
#define likely(x) __builtin_expect(!!(x), 1)
^
cython.c:489:18: warning: dereferencing ‘void *’ pointer
return tp->tp_getattro(obj, attr_name);
^
cython.c:489:18: error: request for member ‘tp_getattro’ in something not a structure or union
I'm currently running on Debian testing, and therefore I have the following versions of Python and Cython :
Python: 3.4.2-2
Cython: 0.21.1-1