Error when compiling Rcpp code in an R package using RStudio

荒凉一梦 提交于 2019-12-01 15:11:19

It is hard to say without having the package available. I guess you miss:

LinkingTo: Rcpp

in your DESCRIPTION file.

Did you by chance start with 'Create a package' in RStudio? If so, are you aware that you may have missed its sibbling option 'Create a package w/ Rcpp' ?

See the page on Using Rcpp with RStudio site for details, and particularly the final section on package building.

Also note that we wrote an entire vignette on using Rcpp with your own packages so I suggest you have a look at that too.

I encountered this same symptom (Rcpp.h: No such file or directory) when trying to install the "xml2" package on an Ubuntu 14 system. In my case the root cause appeared to be a bad installation of package "Rcpp". Some of the files were there (Rcpp/libs) but others were not (Rcpp/include). I am not sure how the system got into this state but I suspect an installation of that package terminated part way through. Re-installing package "Rcpp" cleared up the issue for me.

This is because your GCC has been updated, and it is different than the one you had when you installed R. I had the same problem.

I removed the package "Rccp" by using:

remove.packages("Rcpp")

Then you need to install it again. Just run:

source("https://bioconductor.org/biocLite.R")
biocLite("Rcpp")
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!