crt_constructor / LDC_global_crt_ctor not being called

Marcel marcelpi97 at gmail.com
Mon Apr 13 17:32:19 UTC 2020


On Monday, 13 April 2020 at 17:29:05 UTC, Marcel wrote:
> Hello!
> I tried using both crt_constructor and LDC_global_crt_ctor to 
> execute a piece of code before main(), but it's not being 
> called. Is this normal?
> Here's the function declaration, I'll post the implementation 
> if needed:
>
> pragma(crt_constructor)
> extern(C)
> void init_state();

Oh, I forgot to mention: The test program imports a static 
library that contains the function. Both are in betterC mode.


More information about the digitalmars-d-ldc mailing list