Lazarus/FPC Libraries

From Lazarus wiki
Revision as of 17:06, 19 January 2007 by Mattias2 (talk | contribs) (→‎General)
Jump to navigationJump to search

This page describes the possibilities how to create libraries with Lazarus/FPC and how to use them in projects and packages.

Related Topics

General

Static linking: FPC compiles and links as default a static executable. That means it tells the linker to put all .o files of the project and all packages into one big executable. Advantage: no external dependencies. Disadvantage: No code is shared between different programs on the same computer. And you can not load/unload a plugin.

Dynamic librariers: The idea of dynamic librariers is to share code between programs, saving the memory of the code, reducing the startup time for often used libraries and allowing plugins. The disadvantages of dynamic libraries are: they are slower for seldom used libs, their structure and internals are more complicated (this is mainly a problem for the compiler), their initialization is different (see below) and sharing code requires a version system to only mix compatible code.

Operating Systems

Dynamic libraries:

Operating System Dynamic library Static library
FreeBSD .so .a
MacOSX .dynlib ?
Linux .so .a
Windows .dll ?

FreeBSD

MacOSX

Linux

Windows

ppumove, .ppu, .ppl

Versions, contributing