Difference between revisions of "Lazarus/FPC Libraries"
Line 7: | Line 7: | ||
==General== | ==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), | ||
==Operating Systems== | ==Operating Systems== |
Revision as of 17:04, 19 January 2007
This page describes the possibilities how to create libraries with Lazarus/FPC and how to use them in projects and packages.
Related Topics
- Creating bindings for C libraries - How to convert C header files (.h) to pascal units
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),
Operating Systems
Dynamic libraries:
Operating System | Dynamic library | Static library |
---|---|---|
FreeBSD | .so | .a |
MacOSX | .dynlib | ? |
Linux | .so | .a |
Windows | .dll | ? |