[R] Facing problems with C code compilation - Please help.

neha chaudhry nchaudhr at usc.edu
Wed Sep 22 23:59:10 CEST 2004


Hello,

I started using R a month ago - so I am a novice in this area. I am stuck with a problem and need some help urgently.
I am using windows version of R 1.9.1. I am trying to compile C code in it. I have my C code - "hello.c" is lying in C:\Program Files\R\rw1091

This code is - 

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

=======
Code hello1.R is also lying in the same directory.
This code is -
hello2 <- function(n)
 {
   .C("hello", as.integer))
 }
=======

>From the command prompt, I go into the directory  C:\Program Files\R\rw1091\bin
and I do 
C:\Program Files\R\rw1091\bin>R CMD SHLIB hello.c
'make' is not recognized as an internal or external command,
operable program or batch file.

Perl is installed on my machine. I was wondering why am I getting this error. Could someone please provide me with some pointers on this? Your help will be greatly appreciated.

Thanks,
Neha




More information about the R-help mailing list