I work under Linux.
- I wrote a file
a.cpp
(where there is a functionf
for which I make anextern "c" {}
declaration at the top of the file). - I compiled
g++ -shared -fPIC -o a.so a.cpp
. - I wrote
a.py
where I havectypes.cdll.LoadLibrary('./a.so')
. If I actually run this file then everything is fine and I can call the functionf
. - I wrote
b.py
which hasimport a
. Here I get an error at that import line:dynamic module does not define module export function (PyInit_a)
.
I guess I need to somehow modify the import with some __init__
or something, but maybe something else. Does somebody know what to do?
Thanks!