[fpc-pascal] Initialization in Shared Libraries

Mazola Winstrol mazofeifer at gmail.com
Wed Apr 13 20:56:26 CEST 2016


2016-04-13 15:52 GMT-03:00 Michael Van Canneyt <michael at freepascal.org>:

>
>
> On Wed, 13 Apr 2016, Mazola Winstrol wrote:
>
> Hello list,
>>
>> 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.
>
>
So, what is the correct way to initialize global variables? In a normal
program i can use unit's initialization section or class constructors. But
the documentation is not clear about the the case of shared libraries.

regrds
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20160413/7a47dce0/attachment.html>


More information about the fpc-pascal mailing list