[R] Compiling C codes in Windows

Tong Wang wangtong at usc.edu
Mon Apr 2 10:32:22 CEST 2007


Hi All,
      I have been struggling to figure out how to compile c codes for R use.    I am using Win XP + Cygwin + R binaries. 
After I followed all the instructions in " Building R for Windows" from Murdoch's website, I tried to Run something like :  
R CMD SHLIB C:\R\test.c  , but still didn't get any output.      
     My first question is, does this mean I already did something wrong ?

     Anyway, I assumed that I need to run this command in Cygwin, so I started to reinstall R in Cygwin by compiling the source (I assume it is not possible to call the precompiled binaries from Cygwin).  But I ran into the following problem when I ran  "make all recommended"   in src/gnuwin32/

$ make all recommended
make: ./Rpwd.exe: Command not found
make[1]: ./Rpwd.exe: Command not found
make --no-print-directory -C front-ends Rpwd
make -C ../../include -f Makefile.win version
make Rpwd.exe
gcc  -O3 -Wall -pedantic -I../../include  -c rpwd.c -o rpwd.o
rpwd.c:22:20: direct.h: No such file or directory
rpwd.c: In function `main':
rpwd.c:42: warning: implicit declaration of function `chdir'
rpwd.c:45: warning: implicit declaration of function `getcwd'
make[3]: *** [rpwd.o] Error 1
make[2]: *** [Rpwd] Error 2
make[1]: *** [front-ends/Rpwd.exe] Error 2
make: *** [all] Error 2 


Can I get some help with my quesitons , and some suggestions concerning the best way to solve the whole problem ?

THanks a lot  for your help..

tong



More information about the R-help mailing list