All Manuals > LispWorks® User Guide and Reference Manual > 14 LispWorks as a dynamic library

14.1 Introduction

You can use LispWorks to build a dynamic library on Microsoft Windows, Macintosh, Linux, x86/x64 Solaris and FreeBSD.

To do this, use save-image or deliver and supply a list value for dll-exports. On platforms other than Windows passing dll-added-files also creates a dynamic library.

The result is a library that cannot be executed on its own, but can be dynamically loaded by another process. On Windows this is done with the Windows APIs LoadLibrary and then GetProcAddress. On other platforms the dynamic library can be loaded by dlopen and then dlsym.

The dynamic library is usually of file type dll on Windows, dylib on Macintosh and so on Linux, x86/x64 Solaris or FreeBSD. The first implementation of this functionality in LispWorks was on Microsoft Windows only, therefore the terminology that is used is sometimes Windows-like. In particular "DLL" refers to any dynamic library.

A program that loads a LispWorks dynamic library must be compiled and linked as follows:

Linux
Link with libpthread.so.
FreeBSD
Link with libpthread.so.
macOS
No special requirements.
Solaris
Compile and link multithreaded (for example, using the -mt option to Oracle's cc).

LispWorks® User Guide and Reference Manual - 01 Dec 2021 19:30:20