dyn.load("teste.dll") results:
Error in dyn.load(x, as.logical(local), as.logical(now)) :
unable to load shared library "C:/Dev-Cpp/teste":
LoadLibrary failure: Par??metro incorreto. (Incorrect Parameter)
My C code is (extracted form Writing R Extension):
#include <R.h>
#include <Rinternals.h>
SEXP convolve2(SEXP a, SEXP b)
{
R_len_t i, j, na, nb, nab;
double *xa, *xb, *xab;
SEXP ab;
PROTECT(a = coerceVector(a, REALSXP));
PROTECT(b = coerceVector(b, REALSXP));
na = length(a); nb = length(b); nab = na + nb - 1;
PROTECT(ab = allocVector(REALSXP, nab));
xa = REAL(a); xb = REAL(b);
xab = REAL(ab);
for(i = 0; i < nab; i++) xab[i] = 0.0;
for(i = 0; i < na; i++)
for(j = 0; j < nb; j++) xab[i + j] += xa[i] * xb[j];
UNPROTECT(3);
return(ab);
}
I??m using RCMD under Windows ME.
How can I fix this? Someone can help me ? Prof. Ripley told me to catch
more information debbuging this DLL. Is it hard to do this one under
Windows? It??s necessary modify files SHLIB or MkDLL?