Shared library - kevinlawler/kona GitHub Wiki

The files d.h and d.c can help with building sample shared library

Linux users need to build an additional target k_dyn and use ./k_dyn for loading shared libs. OSX users can use ./k

sample commands :

For so on OSX try

gcc -m64 -flat_namespace -undefined suppress -shared d.c -o shared.so

For dylib on OSX try

gcc -m64 -flat_namespace -undefined suppress -dynamiclib file.c -o file.dylib

invoke the k shell Linux - rlwrap ./k_dyn OSX - rlwrap ./k

b:`"<full path>/shared.so" 2: (`myadd,2);

b[2;3]

5

If you are having trouble with loading, try specifying full path of shared library.

⚠️ **GitHub.com Fallback** ⚠️