Calling D from C

Chris W. wendlec at cd.ie
Mon Mar 12 07:53:09 PDT 2012


I have a problem when calling D functions from C. While I can
perform simple arithmetic operations (i.e. the calculation is
performed in D and returned to C), I experience problems when
trying to perform string/char operations or call functions from
the D standard library (e.g. writefln()). The usual error message
I get is either "Bus error" or "Segmentation fault". I haven't
been able to find the reason for this. The programs compile and
link, however, when run, they terminate with "Bus error" whenever
a D function is performed within the D code, e.g. something like
char[] s2 = s.dup; (s is a char* passed from C). Any hint or help
would be appreciated.

I am using Mac OS X, 10.6.7


More information about the Digitalmars-d mailing list