[Rd] Borland C++ and [R] dyn.load() for windows
huanyu zhou
huzhou at hsph.harvard.edu
Wed Oct 26 23:07:38 CEST 2005
Hi,
I compiled a C program file on Borland C++ 5.5 compiler to get one dll output
(as instructed in the file readme.package).
The C program file is just the example on page 31 of "writing R extensions":
void convolve(double *a, int *na, double *b, int *nb, double *ab)
{
int i, j, nab = *na + *nb - 1;
for(i = 0; i < nab; i++)
ab[i] = 0.0;
for(i = 0; i < *na; i++)
for(j = 0; j < *nb; j++)
ab[i + j] += a[i] * b[j];
}
I used
"bcc32 -Ic:\Borland\bcc55\include -Lc:\Borland\bcc55\Lib -u- -6 -O2 -WDE
c:\Borland\bcc55\convolve.c"
to get "convolve.dll". It seemed fine.
When I used dyn.load("C:\\Borland\\BCC55\\Bin\\convolve.dll") in R (Version
2.0.1 ), it seemed fine also, no warning or error messages. However, when I
used is.loaded("convolve") to check if it was loaded, it showed "False".
I am working on winXP.
What could be the possible reason for that?
thanks
huanyu
More information about the R-devel
mailing list