[Rcpp-devel] Memory Leak found and resolved

2012-08-26 Thread Silkworth,David J.
About a week ago I mentioned a problem I was having maintaining a package, which seemed to require inline compiling for use. I never wanted to use cxxfunplus, and never explored this. It turns out I created a mysterious memory leak, that just happened to be resolved when code was prepared inli

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

2012-08-26 Thread Dirk Eddelbuettel
On 26 August 2012 at 17:31, liu lin wrote: | 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

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

2012-08-26 Thread Dirk Eddelbuettel
On 26 August 2012 at 22:08, Søren Højsgaard wrote: | 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()"` Or use a package in

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

2012-08-26 Thread Dirk Eddelbuettel
On 26 August 2012 at 17:31, liu lin wrote: | 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

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

2012-08-26 Thread Jonathan Olmsted
Liu, A couple of initial reactions. The location of the R.h header is platform dependent. On what platform are you working? You can always just paste the output of the R function "sessionInfo()". Next, the Rcpp team strongly recommends using an "inline"-based approach where possible and an R pack

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

2012-08-26 Thread Michael Hannon
> 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

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

2012-08-26 Thread Søren Højsgaard
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()"` Regards Søren -Original Message- From: liu lin [mailto:lliu.h...@gmail.com]

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

2012-08-26 Thread Søren Højsgaard
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-boun...@lists.r-forge.r-project.org [mailto:rcpp-devel-boun...@lists.r-forge.r-project.org] On Behalf Of liu lin Sent: 26. august 2012

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

2012-08-26 Thread liu lin
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 feat