On Wednesday, 29 April 2020 at 13:12:50 UTC, Johan wrote:
Manually initializing D's runtime is also possible. You need to call rt_init and rt_term: https://dlang.org/phobos/core_runtime.html#.rt_init

What I meant is to
- add a `int main(....)` in a D source file
- rename your current `main` in the C++ source file to something like `the_real_main` - add a forward reference to the D file: `extern(C) int the_real_main(....);`
- call `the_real_main` from the `main` in the D file

That way you don't have to think about how to correctly initialize D's runtime.

-Johan

I thought it was a good idea to ask in the forum!
This actually helps me a lot, thanks!

Reply via email to