[fpc-pascal] Initialization in Shared Libraries

Jonas Maebe jonas.maebe at elis.ugent.be
Wed Apr 13 20:56:26 CEST 2016

Michael Van Canneyt wrote:
> On Wed, 13 Apr 2016, Mazola Winstrol wrote:
>> I writting a cross-platform shared library (.dll, .so). I need to
>> initialize some global variables.
>> As the free pascal doesn't support library events (PROCESS_ATTACH,
>> PROCESS_DETACH), what is the correct to way to do this?
> It does, but it catches them in the system unit; I do not think they are
> exposed.

And hence you can just initialise those variables in the initialization 
section of the library and finalize them (if necessary) in the 
finalization section of the library.


More information about the fpc-pascal mailing list