12.1 Introduction

Free Pascal supports the creation of shared libraries on several operating systems. The following table (table (12.1)) indicates which operating systems support the creation of shared libraries.


Table 12.1: Shared library support




Operating systemsLibrary extensionLibrary prefix



linux .so lib
windows .dll ¡none¿
BeOS .so lib
FreeBSD .so lib
NetBSD .so lib




The library prefix column indicates how the names of the libraries are resolved and created. For example, under linux, the library name will always have the lib prefix when it is created. So if you create a library called mylib, under linux, this will result in the libmylib.so. Furthermore, when importing routines from shared libraries, it is not necessary to give the library prefix or the filename extension.

In the following sections we discuss how to create a library, and how to use these libraries in programs.