[Rcpp-devel] Where is R.h and the other header files?

Søren Højsgaard sorenh at math.aau.dk
Mon Aug 27 00:08:50 CEST 2012

I assume that you compile with 

R CMD SHLIB foo.cpp

In that case, it might help to create a Makevars file with the content
PKG_LIBS=`Rscript -e "Rcpp:::LdFlags()"`
PKG_CXXFLAGS=`Rscript -e "Rcpp:::CxxFlags()"`


-----Original Message-----
From: liu lin [mailto:lliu.hsph at gmail.com] 
Sent: 26. august 2012 23:56
To: Søren Højsgaard
Subject: Re: [Rcpp-devel] Where is R.h and the other header files?

Dear Søren,

I just added a line of #include <R.h> in the helloworld.c as a trial. The output from the compilation is birth_death.hpp:24:15: error: R.h: No such file or directory

Many thanks!
On Aug 26, 2012, at 5:53 PM, Søren Højsgaard wrote:

> Can you show us the output from the compilation and possibly also the contents of your Makevars file?
> Regards
> Søren
> -----Original Message-----
> From: rcpp-devel-bounces at lists.r-forge.r-project.org [mailto:rcpp-devel-bounces at lists.r-forge.r-project.org] On Behalf Of liu lin
> Sent: 26. august 2012 23:32
> To: rcpp-devel at lists.r-forge.r-project.org
> Subject: [Rcpp-devel] Where is R.h and the other header files?
> Dear all,
> I'm trying to write C++ code and call it in R. But after installing the Rcpp package in R, I cannot find where the R.h and the other header file are. When writing code in eclipse, it's really annoying to deal with the errors because of the non-existance of R.h's. Is it a built-in feature of Rcpp or just i'm not on the right track?
> Thanks,
> Lin
> _______________________________________________
> Rcpp-devel mailing list
> Rcpp-devel at lists.r-forge.r-project.org
> https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel

More information about the Rcpp-devel mailing list