Re: How to call 'shared static this()' code of a D shared library?

2020-01-19 Thread Ali Çehreli via Digitalmars-d-learn
On 1/17/20 7:53 PM, Adam D. Ruppe wrote: Did you already try rt_init? That should trigger it I was under the impression that the extern (C) function rt_init() would magically be exposed from the library but 'nm' showed no such symbol. So, I ended up exposing a my_init() function, which

Re: How to call 'shared static this()' code of a D shared library?

2020-01-18 Thread Ali Çehreli via Digitalmars-d-learn
On 1/18/20 6:14 AM, Guillaume Piolat wrote: On Saturday, 18 January 2020 at 03:53:43 UTC, Adam D. Ruppe wrote: Did you already try rt_init? That should trigger it Indeed, this is done by runtime initialization. Thank you, Adam and Guillaume. That tells me I've been using druntime

Re: How to call 'shared static this()' code of a D shared library?

2020-01-18 Thread Adam D. Ruppe via Digitalmars-d-learn
btw there is also a `pragma(crt_constructor)` thing you can put on individual functions for pure C runtime init things.

Re: How to call 'shared static this()' code of a D shared library?

2020-01-18 Thread Guillaume Piolat via Digitalmars-d-learn
On Saturday, 18 January 2020 at 03:53:43 UTC, Adam D. Ruppe wrote: Did you already try rt_init? That should trigger it Indeed, this is done by runtime initialization.

Re: How to call 'shared static this()' code of a D shared library?

2020-01-17 Thread Adam D. Ruppe via Digitalmars-d-learn
Did you already try rt_init? That should trigger it

How to call 'shared static this()' code of a D shared library?

2020-01-17 Thread Ali Çehreli via Digitalmars-d-learn
Simply linking my D shared library with foreign code (Python with the help of ctypes in this case) does not work. What function should I call? What about 'shared static ~this()'? And would the answer be different for 'static this()' etc.? Thank you, Ali