Hi!

I am studying C language to run with R 2.0.0. My system (Windows ME /BR) is configured to run RCMD ( I have installed ActivePerl, Rtools and MinGW as indicated in http://www.murdoch-sutherland.com/Rtools/ an with correct path).
I would like run the coded write below named conv.c (Example from "Write 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);
     }

    When I use C:\Arquiv~1\R\rw2000\bin>RCMD SHLIB -o C:/dev-cpp/teste.dll c:/dev-cpp/conv.c
a teste.dll is created without error and located in that directory, but when I use it in RGui with "Change dir" set to C:/dev-cpp :

>dyn.load("teste")  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)

    I tried find help in R-help, but none answers my questions.
    My doubts are: Why does it occur? How do I fix it? How I can include directives in RCMD -SHLIB, for example, conv.def file to mangling names? It is editing  Makevars.win? 
If anybody have time to answer my question, I apreciate.

Thanks,

O. Neto

PS: There is any discussion list of R in portuguese? I can't find one.



     
	[[alternative HTML version deleted]]


