Almost all foreign code you might want to access exists in some kind of shared library. The meaning of shared library varies among platforms, but for our purposes, we will consider it to include .so files on unix, frameworks on Darwin (and derivatives like Mac OS X), and .dll files on Windows.
Bringing one of these libraries into the Lisp image is normally a two-step process.
define-foreign-library
top-level form.
use-foreign-library
form or by calling the function
load-foreign-library
.
See Loading foreign libraries, for a working example of the above two steps.