Dcalled From C /
Discussion
Discussion
from the news pages about how to do organise the calls from C to D.
From

Define a function called _init():
![]() |
|
It will be called when the .so is loaded, just like DllMain. There's a _fini() function for unload time. "man dlopen" for details. It works even if you are not doing dynamic loading with dlopen()!
From

According to the compiler page, DMD can't handle shared libraries. Are you using GDC?
Conclusion
To run D as a dynamic library under Linux it is necessary to use GDC.