Ravi
Ravi

Reputation: 622

Unable to load Rcpp package

Due to my company's firewall I am manually installing packages from local. No errors when building the package from terminal, but I get an error when I load the package using library function

 unable to load shared object 'C:/Program Files/R/R-3.6.1/library/Rcpp/libs/x64/Rcpp.dll':
  LoadLibrary failure:  The specified procedure could not be found.

And it also throws a prompt

enter image description here

Any help is appreciated thanks!

Tried:

  1. Error in inDL(x, as.logical(local), as.logical(now), ...) : unable to load shared object
  2. https://github.com/r-lib/rlang/issues/306

None of the above seemed to work

Upvotes: 7

Views: 6389

Answers (2)

Ralf Stubner
Ralf Stubner

Reputation: 26823

There has been a significant change in the build tools used for binary R packages on Windows:

Starting with R 4.0.0 (released April 2020), R for Windows uses a brand new toolchain bundle called rtools40.
https://cran.r-project.org/bin/windows/Rtools/

This means one has to be extra careful to get the correct file when downloading binary packages from CRAN, since packages for build with incompatible build tools will not work. At the time of writing this means:

  • Use the ones for r-oldrel for R 3.6
  • Use the ones for r-release for R 4.0

When this question was asked, R 4.0 was still r-devel.

You do not have to think about this things when using the build in install.packages() instead of manually downloading files from CRAN.

Upvotes: 3

melmo
melmo

Reputation: 795

I had this issue. I was using R 4.0.0 in RStudio (1.2.5042). I had been using R just fine all morning and continually had this issue all afternoon. I restarted my computer, updated my packages, and confirmed everything worked well on another computer. Finally I updated to R 4.0.2 and my issue resolved.

My binary package was correctly pathed to 4.0/Rcpp. I still don't know what caused the issue, but since this seemed to fix it hope it will for any future folk with this issue!

Upvotes: 3

Related Questions