Peiyao Li schrieb am 13.03.2018 um 14:53:
> Recently, in our project, we need to call some functions/libraries written
> in C. I have read the official documents and tutorials but am still unclear
> about some technical things.
> In my project, let's say the API function is only *"foo.c"* and its header
> file* "foo.h"* and I only to call the function "*int detect(int num)*" in
> the python program. However, the tricky part is *"foo.c"* also call other C
> functions, for instance, *"tools.c" (tools.h)*
> Here is my question, in pyd file and pyx file, do I have to write the API
> wrapper codes for *tools.c* as well?
No, you only need to declare to Cython what you are using in your Cython
code. The C compiler then sees the whole picture. Just make sure that the
other .c files get compiled and linked in by distutils.
Stefan