Hi all,
Allow me to describe the code structure first:
1. C queue library & c_queue.pxd file.
2. put_stuff.pxd & put_stuff.pyx (import c_queue.pxd)
3. get_stuff_parse.pyx (import c_queue.pxd & put_stuff.pxd)
I created a setup file to compile get_stuff_parse.pyx, and I put "get_stuff_parse.pyx" and "put_stuff.pyx" in the sources since I only want to have a single .so file.
Cython compiles sources into put_stuff.o & get_stuff_parse.o, and both contain symbols from the C queue library, leading to the "duplicate symbols" error.
I can think of two ways to make it work:
1. copy all the content from "put_stuff.pxd" & "put_stuff.pyx" into get_stuff_parse.pyx, but the code would be very messy.
2. compile put and get into two .so files, and import put_stuff.so at the runtime, but I have to manage two binary files, and it is not space-friendly.
I want to know how are you experts dealing with this situation? Is it possible to get only one binary file without the linking error? Any advice is appreciated!