DLL

Kirk McDonald kirklin.mcdonald at gmail.com
Thu May 25 16:37:06 PDT 2006


bsving wrote:
> I have copied the dll.d (where the dllmain is) and then i have a transform_d.d
> file looking like:
> 
> import std.math;
> 
> export void transform(double *x, double *y, double theta)
> {
> double c;
> double s;
> double x_tmp;
> 
> x_tmp = *x;
> c = cos(theta);
> s = sin(theta);
> *x = x_tmp*c + *y*s;
> *y = *y*c - x_tmp*s;
> }
[...]
> What am i doing wrong?
> 
> thanks

Try declaring transform as extern (C), i.e.:

export extern (C)
void transform(double *x, double *y, double theta) {
     // ...
}

-Kirk McDonald



More information about the Digitalmars-d mailing list