Next: , Previous: Foreign Data Structure Examples, Up: Foreign Function Interface


7.6 Loading Shared Object Files

Foreign object files can be loaded into the running Lisp process by calling load-shared-object.

— Function: sb-alien:load-shared-object file

Load a shared library/dynamic shared object file/general dlopenable alien container, such as a .so on an elf platform.

Reloading the same shared object will replace the old definitions; if a symbol was previously referenced thru the object and is not present in the reloaded version an error will be signalled. Sameness is determined using the library filename. Reloading may not work as expected if user or library-code has called dlopen on file.

References to foreign symbols in loaded shared objects do not survive intact through sb-ext:save-lisp-and-die on all platforms. See sb-ext:save-lisp-and-die for details.