I am trying to add my C functions to q. I created dll project in
Visual Studio. To build dll I had to link to c.lib (with corresponding
c.dll). When I do this, I get complaint from linker that function krr
is not found (which is not surprising, since krr is not in c.def
file). So I also tried to link with c.o and c.obj. When I link with
c.o a call to my function crashes. The function looks as follows:
__declspec(dllexport) K func()
{
K res = ktn(KF,2);
return res;
}
The call to the function crashes at ktn(KF,2) when linking to c.o, but
doesn’t crash when linking to c.lib or c.obj.
However the function crashes when linking with any of c.lib, c.o, or
c.obj if I change it to the following:
__declspec(dllexport) K func()
{
return krr(ss(“result”));
}
or
__declspec(dllexport) K func()
{
return ks(“result”);
}
When the dll crashes I get unhandled exception message box with
following message:
“Unhandled exception at 0x10013ee8 (q_fann.dll) in q: 0xC0000005:
Access violation reading location 0x00000004.”
Note that calling krr or ks functions on linux does not produce any
problems.
So the question I have is: Does any workaround exist to resolve these
problems?
Thanks