I'm attempting to wrap a library that's made available as a dylib with development headers into python for use with an existing application. I've created my .i file, which compiles without issue, however when I attempt to link the ndipy_wrap.o and libndi.dylib files I get a number of warnings about symbols not being found.
Running
ld -bundle -flat_namespace -undefined suppress -o _ndipy.so ndipy_wrap.o libndi.4.dylib
means I get a clean exit from the linker, though attempting to load the module into python results in:
import ndipy
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/d5/Projects/ndipy/ndipy.py", line 15, in <module>
import _ndipy
ImportError: dlopen(/Users/d5/Projects/ndipy/_ndipy.so, 2): Symbol not found: __Z14NDIlib_destroyv
Referenced from: /Users/d5/Projects/ndipy/_ndipy.so
Expected in: flat namespace
I'm at a bit of a loss now, and having stared at this for a number of hours I feel I'm not able to see the wood for the trees in my searches.
Many thanks in advance, Dave
Edited to add: the us of -undefined suppress was a suggestion for a similar solution, though I'm currently unable to locate this! Removing this option results in ld: symbol(s) not found for architecture x86_64