[R] linking C and R

Liaw, Andy andy_liaw at merck.com
Wed Dec 21 21:46:22 CET 2005

I don't know much about Macs, but are you using 

R CMD SHLIB whatever.c

to compile the code?  If you simply invoke the compiler by hand, I'd expect
you run into problems like that.


From: Elizabeth Lawson
> hey,
>   I am running R 2.0.1 on a the terminal of my MAC OS X and I 
> have written some C code that I would like to use dynload to 
> bring into R.  When I try to compile the code i get the error 
> R.defines.h no such file or directory.  I know that the file 
> is in resources/include but where do I have to move the file 
> to so that the compiler can access it?  I tried copying 
> Rdefines.h and R_ext folders into the folder where the code 
> is and using" #include "Rdefines.h" instead of #include 
> <Rdefines.h>.  I now get a different error R_ext/Memory.h: no 
> such file or directory even though r_ext is in the folder.
>   Any suggestions?
>   Thanks,
>   Elizabeth Lawson
> __________________________________________________
> 	[[alternative HTML version deleted]]
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! 
> http://www.R-project.org/posting-guide.html

More information about the R-help mailing list