calling a D function from C and C++ code

Walter Bright newshound1 at digitalmars.com
Sat Aug 25 23:49:05 PDT 2007


Bedros Hanounik wrote:
> I'm a lot interested in D recently, and have been reading the
> documentation the wiki, forums, etc. But I could not find a place
> where it explains how to call a D function from C and C++ code
> 
> all the documentation...etc discusses how to bind an existing library
> to D code; which is the most common case, but how about building a
> brand new library written in D; can anyone write a C code (or C++) to
> interface this library in D.


As long as the D functions meant to be called from C are given extern 
(C) linkage, they'll be accessible.



More information about the Digitalmars-d mailing list