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

Peter Dalgaard p.dalgaard at biostat.ku.dk
Thu Sep 23 08:43:47 CEST 2004


"Liaw, Andy" <andy_liaw at merck.com> writes:

> Read and follow the instructions in c:\Program
> Files\R\rw1091\README.packages _very_, _very_ carefully.  Stray from it even
> a bit and you get what you deserve.

Well, not what you want, anyway... (In this case, the first problem
seems to be that you need make.exe from the toolkit *and* to have it
in your path.)
 
> Andy
> 
> > From: neha chaudhry
> > 
> > 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))

Make that as.integer(n) or things will surely come crashing down...

> >  }

-- 
   O__  ---- Peter Dalgaard             Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk)             FAX: (+45) 35327907




More information about the R-help mailing list