First time ever that I try to call subroutines in a Win DLL using R. Have done this before using VBA and Python.

The C code's function argument list contains only double pointers (double *x). The function is declared void, the output value is one of the arguments.
C calling sequence is used.

When inspecting the exports of the DLL with dumpbin I can see that the function I need is exported under the name 'planckwR'.

Loading the DLL with dyn.load(dllpath). Works fine. getLoadedDLLs() shows info on the 'Planck.dll' that I made. So far so good.

Made a function i R like this:

Planckw<-function(Temp) {
    wavelength<-0.0
    .C('planckwR',as.double(Temp),as.double(wavelength))
    return(wavelength)
}

Calling this function, R complains the function 'planckwR' is not in the DLL.

This baffled me as I can see it in the exports table using dumpbin.

I use Visual C++ 97 compiler. Old but works. It does change the FPU control word, which I know it should not. Working on that one too. Any tips?

Any help much appreciated.
Alex van der Spek

______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to