Skip to content Skip to sidebar Skip to footer

Cython Dynamic Library Linking

I'm actually trying to link an existing C library to my Cython program. I have access to the entrypoint header (.h) of the library with all functions declared as: EXPORT_API int _s

Solution 1:

I finally found the solution so I post it if someone needs help in the future !

I work on Windows using Visual Studio to compile my code.

Even if I created my cfuncproject as a Visual C++ project, it didn't compile as a C++ project but as a C project so it worked by default (it only has a .c and a .h files).

My entrypoint.h only contains C-style function declaration but the dll is compiled as a C++ project, that's why it couldn't work, the name mangling was bad.

So I just added language = 'c++'in my setup.py

Post a Comment for "Cython Dynamic Library Linking"