This is an example of how you might make python bindings for a simple cpp struct.
- Make a file that includes all
#include
lines a. They must use<>
not""
- Generate bindings with binder
a. Set the namespace(s) to bind after the flag
--bind
- Compile the cpp files into objects separately
- Link all generated objects into one file with the suffix
.so
- Try importing into python!
There are two examples, one that builds the bindings using a simple bash script,
and another that builds the bindings using cmake. The final lines of each script
also import the test_struct
module and prints a variable of it.