I have a specialized shared library that is loaded dynamically during the execution of an executable. This library provides the function b()
. This function, in turn, calls a function a()
.
The a
function is defined in the executable, not the library itself, so I would like to be able to call some of my executable's code from the library. I've managed to use the -undefined dynamic_lookup
flag to make clang leave these symbols for lazy binding, but dyld still complains when I try to run the executable:
dyld: lazy symbol binding failed: Symbol not found: _a
Referenced from: /usr/local/lib/myLib.dylib
Expected in: flat namespace
How can I get this symbol linked?