Building several dynamic libraries with one shared GC

NonNull non-null at use.startmail.com
Sun Sep 12 20:25:00 UTC 2021


On Sunday, 12 September 2021 at 18:56:50 UTC, Ali Çehreli wrote:
> All initialization functions of the plugins were called 
> automatically in my D test environment and all plugins were 
> usable. The trouble started when the main library was being 
> used in a foreign environment (something like Python loading 
> Python loading C++ library loading our D library): Although the 
> initialization function of the main library was being called, 
> the 'shared static this' functions of the plugins were not 
> being called.

So here, your main dynamic library in turn dynamically loads 
plugins. Did you try simply calling a function exported by a 
plugin from the static constructor in the main library after it 
had made the call to initialize druntime to see if that 
stimulated running the plugin's static constructors first? The 
problem you linked to suggests that might do the job. I haven't 
run into this problem yet myself. But I'm interested.


More information about the Digitalmars-d-learn mailing list