Re: Access violation when calling C DLL from D

2015-11-02 Thread AnoHito via Digitalmars-d-learn
Okay, I finally got it working. The problem was that mrb_value needed to be fully defined in order for my code to work, because it was being passed on the stack directly instead of by a pointer: struct mrb_value { union { mrb_float f; void* p;

Re: Access violation when calling C DLL from D

2015-11-02 Thread AnoHito via Digitalmars-d-learn
On Monday, 2 November 2015 at 15:56:20 UTC, Atila Neves wrote: Try this instead: https://github.com/jacob-carlborg/dstep It's been used to convert C Ruby declarations to D: https://github.com/jacob-carlborg/orbit/tree/master/ruby Atila I might try it later, but I don't think the header conv

Re: Access violation when calling C DLL from D

2015-11-02 Thread Atila Neves via Digitalmars-d-learn
On Monday, 2 November 2015 at 02:30:09 UTC, AnoHito wrote: On Monday, 2 November 2015 at 02:13:29 UTC, BBasile wrote: On Monday, 2 November 2015 at 01:02:45 UTC, AnoHito wrote: [...] the headers are very long and complicated, and porting them entirely to D would be a huge project in and of its

Re: Access violation when calling C DLL from D

2015-11-02 Thread Nicholas Wilson via Digitalmars-d-learn
On Monday, 2 November 2015 at 01:02:45 UTC, AnoHito wrote: Hi, I am trying to write a simple interface to the MRuby Ruby interpreter so I can use ruby scripts in my D program. I was able to get MRuby compiled as a DLL without too much difficulty, but the headers are very long and complicated, a

Re: Access violation when calling C DLL from D

2015-11-01 Thread AnoHito via Digitalmars-d-learn
On Monday, 2 November 2015 at 02:13:29 UTC, BBasile wrote: On Monday, 2 November 2015 at 01:02:45 UTC, AnoHito wrote: [...] the headers are very long and complicated, and porting them entirely to D would be a huge project in and of itself. [...] You can give a try at h2d, the C header to D i

Re: Access violation when calling C DLL from D

2015-11-01 Thread BBasile via Digitalmars-d-learn
On Monday, 2 November 2015 at 01:02:45 UTC, AnoHito wrote: [...] the headers are very long and complicated, and porting them entirely to D would be a huge project in and of itself. [...] You can give a try at h2d, the C header to D interface converter: http://dlang.org/htod.html

Access violation when calling C DLL from D

2015-11-01 Thread AnoHito via Digitalmars-d-learn
Hi, I am trying to write a simple interface to the MRuby Ruby interpreter so I can use ruby scripts in my D program. I was able to get MRuby compiled as a DLL without too much difficulty, but the headers are very long and complicated, and porting them entirely to D would be a huge project in an