Raster load library failure - entry point not found

Hi all,
I am relatively new to RStudio and I am having problems loading the raster package.
I would be very grateful for any help. Thanks :slight_smile:

I installed the raster package and it said "package ‘raster’ successfully unpacked". However, when trying to load the raster library the following error message came up:

Error: package or namespace load failed for ‘raster’ in inDL(x, as.logical(local), as.logical(now), ...):
 unable to load shared object 'C:/Users/Owner/Documents/R/win-library/4.0/Rcpp/libs/x64/Rcpp.dll':
  LoadLibrary failure:  The specified procedure could not be found.
In addition: Warning message:
package ‘raster’ was built under R version 4.0.2

In addition, when I tried this again an error message popped up on the center of the screen:

I also installed four other packages in that session. While they all seemed to install properly they had warning messages. I was able to load the sp, maptools and rgdal packages using the library() function. As the raster package failed to load I wasn't able to load dismo either.
I have included the code and response for this below, in case it might any provide relevant information.

> install.packages("dismo")
WARNING: Rtools is required to build R packages but is not currently installed. Please download and install the appropriate version of Rtools before proceeding:

https://cran.rstudio.com/bin/windows/Rtools/
Installing package into ‘C:/Users/Owner/Documents/R/win-library/4.0’
(as ‘lib’ is unspecified)
trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.0/dismo_1.1-4.zip'
Content type 'application/zip' length 2139557 bytes (2.0 MB)
downloaded 2.0 MB

package ‘dismo’ successfully unpacked and MD5 sums checked

The downloaded binary packages are in
	C:\Users\Owner\AppData\Local\Temp\RtmpM3MWF7\downloaded_packages
> install.packages("maptools")
WARNING: Rtools is required to build R packages but is not currently installed. Please download and install the appropriate version of Rtools before proceeding:

https://cran.rstudio.com/bin/windows/Rtools/
Installing package into ‘C:/Users/Owner/Documents/R/win-library/4.0’
(as ‘lib’ is unspecified)
trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.0/maptools_1.0-1.zip'
Content type 'application/zip' length 2166866 bytes (2.1 MB)
downloaded 2.1 MB

package ‘maptools’ successfully unpacked and MD5 sums checked

The downloaded binary packages are in
	C:\Users\Owner\AppData\Local\Temp\RtmpM3MWF7\downloaded_packages
> install.packages("rgdal")
WARNING: Rtools is required to build R packages but is not currently installed. Please download and install the appropriate version of Rtools before proceeding:

https://cran.rstudio.com/bin/windows/Rtools/
Installing package into ‘C:/Users/Owner/Documents/R/win-library/4.0’
(as ‘lib’ is unspecified)
trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.0/rgdal_1.5-16.zip'
Content type 'application/zip' length 38756058 bytes (37.0 MB)
downloaded 37.0 MB

package ‘rgdal’ successfully unpacked and MD5 sums checked

The downloaded binary packages are in
	C:\Users\Owner\AppData\Local\Temp\RtmpM3MWF7\downloaded_packages
> install.packages("raster")
WARNING: Rtools is required to build R packages but is not currently installed. Please download and install the appropriate version of Rtools before proceeding:

https://cran.rstudio.com/bin/windows/Rtools/
Installing package into ‘C:/Users/Owner/Documents/R/win-library/4.0’
(as ‘lib’ is unspecified)
trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.0/raster_3.3-13.zip'
Content type 'application/zip' length 3554787 bytes (3.4 MB)
downloaded 3.4 MB

package ‘raster’ successfully unpacked and MD5 sums checked

The downloaded binary packages are in
	C:\Users\Owner\AppData\Local\Temp\RtmpM3MWF7\downloaded_packages
> install.packages("sp")
WARNING: Rtools is required to build R packages but is not currently installed. Please download and install the appropriate version of Rtools before proceeding:

https://cran.rstudio.com/bin/windows/Rtools/
Installing package into ‘C:/Users/Owner/Documents/R/win-library/4.0’
(as ‘lib’ is unspecified)
trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.0/sp_1.4-2.zip'
Content type 'application/zip' length 1902782 bytes (1.8 MB)
downloaded 1.8 MB

package ‘sp’ successfully unpacked and MD5 sums checked

The downloaded binary packages are in
	C:\Users\Owner\AppData\Local\Temp\RtmpM3MWF7\downloaded_packages

> library("sp")
Warning message:
package ‘sp’ was built under R version 4.0.2 
> library("raster")
Error: package or namespace load failed for ‘raster’ in inDL(x, as.logical(local), as.logical(now), ...):
 unable to load shared object 'C:/Users/Owner/Documents/R/win-library/4.0/Rcpp/libs/x64/Rcpp.dll':
  LoadLibrary failure:  The specified procedure could not be found.
In addition: Warning message:
package ‘raster’ was built under R version 4.0.2

There was some issues with the 4.0.0 R version on Windows systems, I would suggest updating to the latest version 4.0.2, updating your packages with the checkBuilt = TRUE option and reinstalling the Rcpp package.
Also, you may want to install and configure RTools40 in your system.
https://cran.r-project.org/bin/windows/Rtools/

2 Likes

Thanks! updating to the latest version of R solved the problem :slight_smile:

Does not having installed RTools have a detrimental impact when working with R?

Not necessarily, you only need it to install packages from source, if there are binaries available for all the packages you are going to be working with, then you are not going to need it.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.