Hi,

I'm trying to get C code working with R. This is my first time writing C on Windows and I'm making a mess of it. Help!

I'm following the example in Roger Peng's "An Introduction to the .C interface to R". The C code is:

#include <R.h>
void hello(int *n){
        int i;
        for(i=0; i < *n; i++) {
                Rprintf("Hello, world!\n");
        }
}

I seem to be unable to make Windows pay attention to additions to the PATH variable so I stuck the code (test.c) into the $R_HOME\bin directory. I copied into the same directory mingw32-make.exe and renamed it make.exe (as the perl script SHLIB seems to want a make.exe).

When I type Rcmd SHLIB test.c at a command prompt I get the following:

C:\Program Files\R\rw1091\bin>Rcmd SHLIB test.c
C:/PROGRA~1/R/rw1091/src/gnuwin32/MkRules:110: warning: overriding commands for target `.c.d'
C:/PROGRA~1/R/rw1091/src/gnuwin32/MkRules:98: warning: ignoring old commands for target `.c.d'
C:/PROGRA~1/R/rw1091/src/gnuwin32/MkRules:126: warning: overriding commands for target `.c.o'
C:/PROGRA~1/R/rw1091/src/gnuwin32/MkRules:114: warning: ignoring old commands for target `.c.o'
MkRules:110: warning: overriding commands for target `.c.d'
MkRules:98: warning: ignoring old commands for target `.c.d'
MkRules:126: warning: overriding commands for target `.c.o'
MkRules:114: warning: ignoring old commands for target `.c.o'
MkRules:110: warning: overriding commands for target `.c.d'
MkRules:98: warning: ignoring old commands for target `.c.d'
MkRules:126: warning: overriding commands for target `.c.o'
MkRules:114: warning: ignoring old commands for target `.c.o'
make: *** No rule to make target `'test.c'', needed by `makeMakedeps'. Stop.


I'm obviously an idiot but any help offered would be much appreciated.

--
SC

______________________________________________
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

Reply via email to