hello2.c
:hello2_caller.pyx
:setup.hello2_caller.py
:build it:
import and use it:
The compiler complains:
But it works.
UPDATE: the problem is that these two declarations are not the same:
and we need to have the second one.
hello2.c
:#include <stdio.h> |
hello2_caller.pyx
:cdef extern from "hello2.c": |
setup.hello2_caller.py
:from distutils.core import setup |
python setup.hello2_caller.py build_ext --inplace |
>>> import hello2_caller |
In file included from hello2_caller.c:219: |
void f(); |
$ python setup.hello2_caller.py build_ext --inplace |
$ python |