Rcpp can't find Rtools: “Error 1 occurred building shared library”

前端 未结 1 1703
野性不改
野性不改 2020-12-09 11:20

I am running into a simple setup problem with Rcpp and I cannot get it to work. I tried to follow this example http://www.r-bloggers.com/user2013-the-rcpp-tutorial/ But whe

相关标签:
1条回答
  • 2020-12-09 11:56

    Looks like neither your R binaries nor Rtools directories are in your system's PATH environment variable. Try this:

    > writeLines(strsplit(Sys.getenv("PATH"), ";")[[1L]])
    C:\R\Rtools\bin
    C:\R\Rtools\gcc-4.6.3\bin
    C:\R\R-devel\bin\x64
    [... and so on ...]
    

    If your directories C:\R\R-3.0.1\bin\x64\ and C:\R\Rtools\bin\ & C:\R\Rtools\gcc-*.*.*\bin\ (replace \gcc-*-*-*\ with your version of the gcc-binaries) are not listed, the needed components can't be found. To be on the safe side, also create a system variable called CYGWIN with the value nodosfilewarning.

    After changing/creating the PATH and CYGWIN variables, reboot. Then it should work and you can place your sources anywhere on your machine and also compile them manually using R CMD SHLIB.

    0 讨论(0)
提交回复
热议问题