Re: Exec function D from C++

2015-06-21 Thread Jacob Carlborg via Digitalmars-d-learn
On 21/06/15 16:09, Sean Campbell wrote: extern(C++) void d_initialize() { Runtime.initialize(); } extern(C++) void d_terminate() { Runtime.terminate(); } These two functions are not necessary. There are already functions in druntime which are supposed to be called from C/C++: ex

Re: Exec function D from C++

2015-06-21 Thread Sean Campbell via Digitalmars-d-learn
On Sunday, 21 June 2015 at 13:12:03 UTC, MGW wrote: Linux 32, dmd 2.067.0 I want to connect and execute function D from main() C++. d1.d import core.stdc.stdio; extern (C++) void d1() { printf("printf - exec d1()"); } main_c1.cpp #include void d1(void); int main(voi

Exec function D from C++

2015-06-21 Thread MGW via Digitalmars-d-learn
Linux 32, dmd 2.067.0 I want to connect and execute function D from main() C++. d1.d import core.stdc.stdio; extern (C++) void d1() { printf("printf - exec d1()"); } main_c1.cpp #include void d1(void); int main(void) { d1(); return 0; } compile dmd