Compililng C++ and D together without going mad

Jan Hönig hrominium at
Wed Apr 29 13:02:36 UTC 2020

On Wednesday, 29 April 2020 at 11:38:16 UTC, Johan wrote:
> LDC is a (somewhat complex) project with D and C++ code (and 
> external C++ libraries).
> I think it will help you if your main() is in D (such that 
> druntime is automatically initialized for you).
> -Johan

Hmmm, a D main means i need to do quite some C++ bindings, with 
which I have 0 experience. I cannot even say if it will be 

I will probably need:
c++ stdlib's unique_ptr.
And then i need to subclass a C++ class and extern this D 

It sounds easier to me, to manually initialize D's runtime (i 
imagine it being some function calls), build everything with C++, 
and just call D functions from C++.

Or do you think it is worth the hassle with bindings?

I have done C++ bindings once,years ago in python and it was a 
not pleasent.

More information about the Digitalmars-d-learn mailing list