Is it possible to call D functions from C++

Namal via Digitalmars-d digitalmars-d at
Wed Mar 18 07:50:19 PDT 2015

alright, thanks alot. Now I have.


import std.stdio;

extern (C++) int foo(int i, int j, int k)
     writefln("i = %s", i);
     writefln("j = %s", j);
     writefln("k = %s", k);
     return 1;

and main.cpp

int foo(int i, int j, int k);

int main()

Can you help me show how to compile and link it together please, 
thank you.

More information about the Digitalmars-d mailing list