5

I am developing a package using Rcpp and another third party C++ library. When I tried to install the package, I got

Error in inDL(x, as.logical(local), as.logical(now), ...) : 
  unable to load shared object 'C:/Users/Admin/Documents/R/win-library/2.15/packagename/libs/i386/package.dll':
   LoadLibrary failure:  The specified module could not be found.

In 32-bit Windows OS, following an advice from my colleague, I fixed the problem by adding location of following dlls from MingW to system path.

libgcc_s_dw2-1.dll

But 64-bit Windows, I get the same error even with the dll although I am using 32-bit R.

So my question:

Is there any way to know why The specified module could not be found error occurs? I mean I would like to know which module is missing. Maybe verbose option some where?

Tae-Sung Shin
  • 20,215
  • 33
  • 138
  • 240
  • We document how to use Rcpp with other libraries in the Rcpp-package vignette, as well as the other vignette. I suspect your link step is wrong; but it is impossible to tell from the information you supplied. – Dirk Eddelbuettel Nov 21 '12 at 16:09
  • When you say "system path," do you mean under the 32-bit SysWoW directory? – Matthew Lundberg Nov 21 '12 at 16:17

5 Answers5

1

There is not an easy way in R to get more information from the error I mentioned. But I found free software to find which dependency the dill is missing by following web site: http://www.dependencywalker.com/

Using the software I was able to find following dlls are needed to be in system path.

GPSVC.dll
IESHIMS.dll
SYSNIFY.dll
Tae-Sung Shin
  • 20,215
  • 33
  • 138
  • 240
  • Looks like your mixing VS-compiled and MinGW-compiled libraries. That is not for the faint of heart, and not what is generally document for R or Rcpp. – Dirk Eddelbuettel Nov 26 '12 at 04:06
  • Then your path is wrong, plain and simple. How to build packages on Windows is clearly described in several places, but you have to follow it to the letter. – Dirk Eddelbuettel Nov 26 '12 at 12:32
0

As hinted by the post Win 7, 64 bit, dll problems, the output of dependencywalker may be misleading. In my case, the path to "Microsoft SQL Server" was missing in my system %PATH% environment variable (deliberately removed, because it seemed unnecessary). After that the LoadLibrary error vanished and the library loaded.

Community
  • 1
  • 1
Egus
  • 121
  • 7
0

I belive you can Run you R software as Administrator you can solve your problem... You may check: Unable to load any package in R (unable to load shared object)

Community
  • 1
  • 1
Jalles10
  • 419
  • 4
  • 8
0

I ran into this same problem and the issue turned out to be that Windows was not looking in the right place for jvm.dll. Solution was to add location of this dll to Windows PATH variable.

Found solution here: Using the rJava package on Win7 64 bit with R

Instructions on how to edit PATH variable here: https://www.java.com/en/download/help/path.xml

Community
  • 1
  • 1
wwwhitney
  • 101
  • 1
0

I was also facing the error

"Warning in install.packages : installation of package ‘rlang’ had non-zero exit status".

I followed the following steps

  1. restart the RStudio,
  2. install.packages("tidyverse")
  3. removed the folder C:/Users/CHILIKA/Documents/R/win-library/3.5/00LOCK-rlang

and again

  1. install.packages("rlang") then rlang sucessfully installed.
Daniele Santi
  • 771
  • 3
  • 24
  • 31