> > However it is not clear how this function is being looked up? How does > ccall know where to look for this function? >
This is apparently undocumented behavior: the single argument (symbol-only) form of `ccall` looks in the symbol table for the process, so it should find symbols in any library that has been `dlopen`ed (modulo dlopen binding options). If you are linking your executable against libjulia then I think this form will "just work" as long as you export your symbols correctly. On Wed, Dec 30, 2015 at 12:12 PM, Lance Larsen <[email protected]> wrote: > I would like to embed julia in an executable and use julia to call some > routines exported from the executable. I noticed that the julia executable > exports some functions, and I read that julia can read symbols from the > executable. However, I have been unable to find a ccall example where a > symbol is loaded directly from the executable. I do see some places where > ccall is called without specifying a library file that the function is > located in. For example in REPL.jl there is a call: > > ccall(:jl_raise_debugger, Int, ()) > > However it is not clear how this function is being looked up? How does > ccall know where to look for this function? >
