Dcalled From C /
Discussion
Difference (last change) (Author, normal page display)
Changed: 5c5
From Posting:digitalmars.D/7361 |
From NG:digitalmars.D/7361 |
Changed: 21c21
From Posting:digitalmars.D/7362 |
From NG:digitalmars.D/7362 |
Discussion
from the news pages about how to do organise the calls from C to D.
From NG:digitalmars.D/7361
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 NG:digitalmars.D/7362
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.