Why using wrappers for D?

Adam D. Ruppe via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Mon Oct 3 05:54:03 PDT 2016


On Monday, 3 October 2016 at 12:47:48 UTC, Chalix wrote:
> I read a bit about creating libraries in C++, and I found out, 
> this is not possible, because there is no definition of the API.


It is possible, you just need to match compilers with the library 
in C++, whereas C libraries don't need such an exact match.

With your Qt library, you get a build of it that is compatible 
with the compiler you use to build your application (either 
compiling it yourself or getting it from an OS package repo where 
they did it for you for your OS version)

> you mean by "turn C functions into classes"?

Wrap the C functions inside D classes. So they write D code that 
calls the C functions, then you use their D code.


More information about the Digitalmars-d-learn mailing list