C binding with D function

llaine via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Wed Aug 3 08:41:55 PDT 2016


On Wednesday, 3 August 2016 at 15:24:56 UTC, llaine wrote:
> On Wednesday, 3 August 2016 at 15:14:24 UTC, Kagamin wrote:

After digging a bit more, I get a different error.

import std.stdio;
import core.runtime;

extern(C)
{
   void initialize()
   {
     Runtime.initialize();
   }

   void foo(string str)
   {
     writeln(str);
   }


   void terminate()
   {
     Runtime.terminate();
   }

}

on my code ofc I call the three methods and I get

uncaught exception
dwarfeh(224) fatal error
Abandon (core dumped)



More information about the Digitalmars-d-learn mailing list