Roxygen2: Installation ERROR: compilation failed for package 'roxygen2'

Created on 28 Jun 2020  ·  24Comments  ·  Source: r-lib/roxygen2

Here is the error message.

> install.packages("roxygen2")

  There is a binary version available but the source version is later:
         binary source needs_compilation
roxygen2  7.1.0  7.1.1              TRUE

installing the source package ‘roxygen2’

试开URL’https://cran.rstudio.com/src/contrib/roxygen2_7.1.1.tar.gz'
Content type 'application/x-gzip' length 254118 bytes (248 KB)
downloaded 248 KB

* installing *source* package 'roxygen2' ...
** 成功将'roxygen2'程序包解包并MD5和检查
** using staged installation
** libs

*** arch - i386
"c:/rtools40/mingw32/bin/"g++ -std=gnu++11  -I"C:/PROGRA~1/R/R-40~1.0/include" -DNDEBUG  -I'C:/Program Files/R/R-4.0.0/library/Rcpp/include'        -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign -c RcppExports.cpp -o RcppExports.o
sh: c:/rtools40/mingw32/bin/g++: No such file or directory
make: *** [C:/PROGRA~1/R/R-40~1.0/etc/i386/Makeconf:229: RcppExports.o] Error 127
ERROR: compilation failed for package 'roxygen2'
* removing 'C:/Program Files/R/R-4.0.0/library/roxygen2'
Warning in install.packages :
  installation of package ‘roxygen2’ had non-zero exit status

The downloaded source packages are in
    ‘C:\Users\lijiaxiang\AppData\Local\Temp\Rtmp4KjrXg\downloaded_packages’

Here is the session information.

> sessionInfo()
R version 4.0.0 (2020-04-24)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 7 x64 (build 7601) Service Pack 1

Matrix products: default

locale:
[1] LC_COLLATE=Chinese (Simplified)_People's Republic of China.936 
[2] LC_CTYPE=Chinese (Simplified)_People's Republic of China.936   
[3] LC_MONETARY=Chinese (Simplified)_People's Republic of China.936
[4] LC_NUMERIC=C                                                   
[5] LC_TIME=Chinese (Simplified)_People's Republic of China.936    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

loaded via a namespace (and not attached):
 [1] fansi_0.4.1      digest_0.6.25    crayon_1.3.4     assertthat_0.2.1 R6_2.4.1         reprex_0.3.0    
 [7] evaluate_0.14    rlang_0.4.6      cli_2.0.2        rstudioapi_0.11  fs_1.4.1         whisker_0.4     
[13] ellipsis_0.3.1   rmarkdown_2.3    tools_4.0.0      glue_1.4.1       xfun_0.15        compiler_4.0.0  
[19] memoise_1.1.0    htmltools_0.5.0  knitr_1.29      

Most helpful comment

This is a base R ABI change, probably unintended: https://www.mail-archive.com/[email protected]/msg42398.html

All 24 comments

You need a C++ compiler to install roxygen2 from source. Seems like you are on Windows, so you would need to install Rtools40 from https://cran.r-project.org/bin/windows/Rtools/

CRAN will have a roxygen2 7.1.1 binary in a couple of days, so you could also just wait for that.

Or you can install the 7.1.0 binary if you don't need the bug fixes in 7.1.1.

@gaborcsardi thanks for your reply. I install Rtools 4.0 already but cannot install roxygen2 still with different error.

> install.packages("roxygen2")

  There is a binary version available but the source version is later:
         binary source needs_compilation
roxygen2  7.1.0  7.1.1              TRUE

installing the source package ‘roxygen2’

试开URL’https://cran.rstudio.com/src/contrib/roxygen2_7.1.1.tar.gz'
Content type 'application/x-gzip' length 254118 bytes (248 KB)
downloaded 248 KB

* installing *source* package 'roxygen2' ...
** 成功将'roxygen2'程序包解包并MD5和检查
** using staged installation
** libs

*** arch - i386
"C:/rtools40/mingw32/bin/"g++ -std=gnu++11  -I"C:/PROGRA~1/R/R-40~1.0/include" -DNDEBUG  -I'C:/Program Files/R/R-4.0.0/library/Rcpp/include'        -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign -c RcppExports.cpp -o RcppExports.o
"C:/rtools40/mingw32/bin/"g++ -std=gnu++11  -I"C:/PROGRA~1/R/R-40~1.0/include" -DNDEBUG  -I'C:/Program Files/R/R-4.0.0/library/Rcpp/include'        -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign -c escapeExamples.cpp -o escapeExamples.o
"C:/rtools40/mingw32/bin/"g++ -std=gnu++11  -I"C:/PROGRA~1/R/R-40~1.0/include" -DNDEBUG  -I'C:/Program Files/R/R-4.0.0/library/Rcpp/include'        -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign -c isComplete.cpp -o isComplete.o
"C:/rtools40/mingw32/bin/"g++ -std=gnu++11  -I"C:/PROGRA~1/R/R-40~1.0/include" -DNDEBUG  -I'C:/Program Files/R/R-4.0.0/library/Rcpp/include'        -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign -c leadingSpaces.cpp -o leadingSpaces.o
"C:/rtools40/mingw32/bin/"g++ -std=gnu++11  -I"C:/PROGRA~1/R/R-40~1.0/include" -DNDEBUG  -I'C:/Program Files/R/R-4.0.0/library/Rcpp/include'        -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign -c parser2.cpp -o parser2.o
"C:/rtools40/mingw32/bin/"g++ -std=gnu++11  -I"C:/PROGRA~1/R/R-40~1.0/include" -DNDEBUG  -I'C:/Program Files/R/R-4.0.0/library/Rcpp/include'        -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign -c wrapUsage.cpp -o wrapUsage.o
C:/rtools40/mingw32/bin/g++ -std=gnu++11 -shared -s -static-libgcc -o roxygen2.dll tmp.def RcppExports.o escapeExamples.o isComplete.o leadingSpaces.o parser2.o wrapUsage.o -LC:/PROGRA~1/R/R-40~1.0/bin/i386 -lR
installing to C:/Program Files/R/R-4.0.0/library/00LOCK-roxygen2/00new/roxygen2/libs/i386

*** arch - x64
"C:/rtools40/mingw64/bin/"g++ -std=gnu++11  -I"C:/PROGRA~1/R/R-40~1.0/include" -DNDEBUG  -I'C:/Program Files/R/R-4.0.0/library/Rcpp/include'        -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign -c RcppExports.cpp -o RcppExports.o
"C:/rtools40/mingw64/bin/"g++ -std=gnu++11  -I"C:/PROGRA~1/R/R-40~1.0/include" -DNDEBUG  -I'C:/Program Files/R/R-4.0.0/library/Rcpp/include'        -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign -c escapeExamples.cpp -o escapeExamples.o
"C:/rtools40/mingw64/bin/"g++ -std=gnu++11  -I"C:/PROGRA~1/R/R-40~1.0/include" -DNDEBUG  -I'C:/Program Files/R/R-4.0.0/library/Rcpp/include'        -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign -c isComplete.cpp -o isComplete.o
"C:/rtools40/mingw64/bin/"g++ -std=gnu++11  -I"C:/PROGRA~1/R/R-40~1.0/include" -DNDEBUG  -I'C:/Program Files/R/R-4.0.0/library/Rcpp/include'        -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign -c leadingSpaces.cpp -o leadingSpaces.o
"C:/rtools40/mingw64/bin/"g++ -std=gnu++11  -I"C:/PROGRA~1/R/R-40~1.0/include" -DNDEBUG  -I'C:/Program Files/R/R-4.0.0/library/Rcpp/include'        -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign -c parser2.cpp -o parser2.o
"C:/rtools40/mingw64/bin/"g++ -std=gnu++11  -I"C:/PROGRA~1/R/R-40~1.0/include" -DNDEBUG  -I'C:/Program Files/R/R-4.0.0/library/Rcpp/include'        -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign -c wrapUsage.cpp -o wrapUsage.o
C:/rtools40/mingw64/bin/g++ -std=gnu++11 -shared -s -static-libgcc -o roxygen2.dll tmp.def RcppExports.o escapeExamples.o isComplete.o leadingSpaces.o parser2.o wrapUsage.o -LC:/PROGRA~1/R/R-40~1.0/bin/x64 -lR
installing to C:/Program Files/R/R-4.0.0/library/00LOCK-roxygen2/00new/roxygen2/libs/x64
** R
** inst
** byte-compile and prepare package for lazy loading
Error in inDL(x, as.logical(local), as.logical(now), ...) : 
  无法载入共享目标对象‘C:/Program Files/R/R-4.0.0/library/Rcpp/libs/x64/Rcpp.dll’::
  LoadLibrary failure:  找不到指定的程序。
Calls: <Anonymous> ... asNamespace -> loadNamespace -> library.dynam -> dyn.load -> inDL
停止执行
ERROR: lazy loading failed for package 'roxygen2'
* removing 'C:/Program Files/R/R-4.0.0/library/roxygen2'
Warning in install.packages :
  installation of package ‘roxygen2’ had non-zero exit status

The downloaded source packages are in
    ‘C:\Users\lijiaxiang\AppData\Local\Temp\RtmpkjgCmu\downloaded_packages’

Here is information with the r version and rtools.

> R.Version()$version.string
[1] "R version 4.0.0 (2020-04-24)"
> Sys.which("make")
                              make 
"C:\\rtools40\\usr\\bin\\make.exe" 
  无法载入共享目标对象‘C:/Program Files/R/R-4.0.0/library/Rcpp/libs/x64/Rcpp.dll’::

  LoadLibrary failure:  找不到指定的程序。

means that roxygen2 is loaded in this or another R session. You need to quit your other sessions, and install roxygen2 in a new session, before loading any packages.

@gaborcsardi Thanks. But I get the same error. I open only one R session inside a RStudio windows.

> install.packages("roxygen2")

  There is a binary version available but the source version is later:
         binary source needs_compilation
roxygen2  7.1.0  7.1.1              TRUE

installing the source package ‘roxygen2’

试开URL’https://cran.rstudio.com/src/contrib/roxygen2_7.1.1.tar.gz'
Content type 'application/x-gzip' length 254118 bytes (248 KB)
downloaded 248 KB

* installing *source* package 'roxygen2' ...
** 成功将'roxygen2'程序包解包并MD5和检查
** using staged installation
** libs

*** arch - i386
"C:/rtools40/mingw32/bin/"g++ -std=gnu++11  -I"C:/PROGRA~1/R/R-40~1.0/include" -DNDEBUG  -I'C:/Program Files/R/R-4.0.0/library/Rcpp/include'        -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign -c RcppExports.cpp -o RcppExports.o
"C:/rtools40/mingw32/bin/"g++ -std=gnu++11  -I"C:/PROGRA~1/R/R-40~1.0/include" -DNDEBUG  -I'C:/Program Files/R/R-4.0.0/library/Rcpp/include'        -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign -c escapeExamples.cpp -o escapeExamples.o
"C:/rtools40/mingw32/bin/"g++ -std=gnu++11  -I"C:/PROGRA~1/R/R-40~1.0/include" -DNDEBUG  -I'C:/Program Files/R/R-4.0.0/library/Rcpp/include'        -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign -c isComplete.cpp -o isComplete.o
"C:/rtools40/mingw32/bin/"g++ -std=gnu++11  -I"C:/PROGRA~1/R/R-40~1.0/include" -DNDEBUG  -I'C:/Program Files/R/R-4.0.0/library/Rcpp/include'        -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign -c leadingSpaces.cpp -o leadingSpaces.o
"C:/rtools40/mingw32/bin/"g++ -std=gnu++11  -I"C:/PROGRA~1/R/R-40~1.0/include" -DNDEBUG  -I'C:/Program Files/R/R-4.0.0/library/Rcpp/include'        -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign -c parser2.cpp -o parser2.o
"C:/rtools40/mingw32/bin/"g++ -std=gnu++11  -I"C:/PROGRA~1/R/R-40~1.0/include" -DNDEBUG  -I'C:/Program Files/R/R-4.0.0/library/Rcpp/include'        -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign -c wrapUsage.cpp -o wrapUsage.o
C:/rtools40/mingw32/bin/g++ -std=gnu++11 -shared -s -static-libgcc -o roxygen2.dll tmp.def RcppExports.o escapeExamples.o isComplete.o leadingSpaces.o parser2.o wrapUsage.o -LC:/PROGRA~1/R/R-40~1.0/bin/i386 -lR
installing to C:/Program Files/R/R-4.0.0/library/00LOCK-roxygen2/00new/roxygen2/libs/i386

*** arch - x64
"C:/rtools40/mingw64/bin/"g++ -std=gnu++11  -I"C:/PROGRA~1/R/R-40~1.0/include" -DNDEBUG  -I'C:/Program Files/R/R-4.0.0/library/Rcpp/include'        -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign -c RcppExports.cpp -o RcppExports.o
"C:/rtools40/mingw64/bin/"g++ -std=gnu++11  -I"C:/PROGRA~1/R/R-40~1.0/include" -DNDEBUG  -I'C:/Program Files/R/R-4.0.0/library/Rcpp/include'        -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign -c escapeExamples.cpp -o escapeExamples.o
"C:/rtools40/mingw64/bin/"g++ -std=gnu++11  -I"C:/PROGRA~1/R/R-40~1.0/include" -DNDEBUG  -I'C:/Program Files/R/R-4.0.0/library/Rcpp/include'        -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign -c isComplete.cpp -o isComplete.o
"C:/rtools40/mingw64/bin/"g++ -std=gnu++11  -I"C:/PROGRA~1/R/R-40~1.0/include" -DNDEBUG  -I'C:/Program Files/R/R-4.0.0/library/Rcpp/include'        -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign -c leadingSpaces.cpp -o leadingSpaces.o
"C:/rtools40/mingw64/bin/"g++ -std=gnu++11  -I"C:/PROGRA~1/R/R-40~1.0/include" -DNDEBUG  -I'C:/Program Files/R/R-4.0.0/library/Rcpp/include'        -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign -c parser2.cpp -o parser2.o
"C:/rtools40/mingw64/bin/"g++ -std=gnu++11  -I"C:/PROGRA~1/R/R-40~1.0/include" -DNDEBUG  -I'C:/Program Files/R/R-4.0.0/library/Rcpp/include'        -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign -c wrapUsage.cpp -o wrapUsage.o
C:/rtools40/mingw64/bin/g++ -std=gnu++11 -shared -s -static-libgcc -o roxygen2.dll tmp.def RcppExports.o escapeExamples.o isComplete.o leadingSpaces.o parser2.o wrapUsage.o -LC:/PROGRA~1/R/R-40~1.0/bin/x64 -lR
installing to C:/Program Files/R/R-4.0.0/library/00LOCK-roxygen2/00new/roxygen2/libs/x64
** R
** inst
** byte-compile and prepare package for lazy loading
Error in inDL(x, as.logical(local), as.logical(now), ...) : 
  无法载入共享目标对象‘C:/Program Files/R/R-4.0.0/library/Rcpp/libs/x64/Rcpp.dll’::
  LoadLibrary failure:  找不到指定的程序。
Calls: <Anonymous> ... asNamespace -> loadNamespace -> library.dynam -> dyn.load -> inDL
停止执行
ERROR: lazy loading failed for package 'roxygen2'
* removing 'C:/Program Files/R/R-4.0.0/library/roxygen2'
Warning in install.packages :
  installation of package ‘roxygen2’ had non-zero exit status

The downloaded source packages are in
    ‘C:\Users\lijiaxiang\AppData\Local\Temp\RtmpqkQkav\downloaded_packages’

I open only one R session inside a RStudio windows.

Then you have a frozen session that you cannot see. Start task manager, and eliminate all RStudio and Rterm, etc. apps and processes.

Start task manager, and eliminate all RStudio and Rterm, etc. apps and processes.

Yes, I am sure only one R session I open. I will restart my machine and try again. @gaborcsardi

@gaborcsardi I restart my machine and open the rstudio once and run install.packages but get the same error.

R version 4.0.0 (2020-04-24) -- "Arbor Day"
Copyright (C) 2020 The R Foundation for Statistical Computing
Platform: x86_64-w64-mingw32/x64 (64-bit)

R是自由软件,不带任何担保。
在某些条件下你可以将其自由散布。
用'license()'或'licence()'来看散布的详细条件。

R是个合作计划,有许多人为之做出了贡献.
用'contributors()'来看合作者的详细情况
用'citation()'会告诉你如何在出版物中正确地引用R或R程序包。

用'demo()'来看一些示范程序,用'help()'来阅读在线帮助文件,或
用'help.start()'通过HTML浏览器来看帮助文件。
用'q()'退出R.

[Workspace loaded from D:/work/imp_rmd/.RData]

> install.packages("roxygen2")

  There is a binary version available but the source version is later:
         binary source needs_compilation
roxygen2  7.1.0  7.1.1              TRUE

installing the source package ‘roxygen2’

试开URL’https://cran.rstudio.com/src/contrib/roxygen2_7.1.1.tar.gz'
Content type 'application/x-gzip' length 254118 bytes (248 KB)
downloaded 248 KB

* installing *source* package 'roxygen2' ...
** 成功将'roxygen2'程序包解包并MD5和检查
** using staged installation
** libs

*** arch - i386
"C:/rtools40/mingw32/bin/"g++ -std=gnu++11  -I"C:/PROGRA~1/R/R-40~1.0/include" -DNDEBUG  -I'C:/Program Files/R/R-4.0.0/library/Rcpp/include'        -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign -c RcppExports.cpp -o RcppExports.o
"C:/rtools40/mingw32/bin/"g++ -std=gnu++11  -I"C:/PROGRA~1/R/R-40~1.0/include" -DNDEBUG  -I'C:/Program Files/R/R-4.0.0/library/Rcpp/include'        -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign -c escapeExamples.cpp -o escapeExamples.o
"C:/rtools40/mingw32/bin/"g++ -std=gnu++11  -I"C:/PROGRA~1/R/R-40~1.0/include" -DNDEBUG  -I'C:/Program Files/R/R-4.0.0/library/Rcpp/include'        -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign -c isComplete.cpp -o isComplete.o
"C:/rtools40/mingw32/bin/"g++ -std=gnu++11  -I"C:/PROGRA~1/R/R-40~1.0/include" -DNDEBUG  -I'C:/Program Files/R/R-4.0.0/library/Rcpp/include'        -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign -c leadingSpaces.cpp -o leadingSpaces.o
"C:/rtools40/mingw32/bin/"g++ -std=gnu++11  -I"C:/PROGRA~1/R/R-40~1.0/include" -DNDEBUG  -I'C:/Program Files/R/R-4.0.0/library/Rcpp/include'        -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign -c parser2.cpp -o parser2.o
"C:/rtools40/mingw32/bin/"g++ -std=gnu++11  -I"C:/PROGRA~1/R/R-40~1.0/include" -DNDEBUG  -I'C:/Program Files/R/R-4.0.0/library/Rcpp/include'        -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign -c wrapUsage.cpp -o wrapUsage.o
C:/rtools40/mingw32/bin/g++ -std=gnu++11 -shared -s -static-libgcc -o roxygen2.dll tmp.def RcppExports.o escapeExamples.o isComplete.o leadingSpaces.o parser2.o wrapUsage.o -LC:/PROGRA~1/R/R-40~1.0/bin/i386 -lR
installing to C:/Program Files/R/R-4.0.0/library/00LOCK-roxygen2/00new/roxygen2/libs/i386

*** arch - x64
"C:/rtools40/mingw64/bin/"g++ -std=gnu++11  -I"C:/PROGRA~1/R/R-40~1.0/include" -DNDEBUG  -I'C:/Program Files/R/R-4.0.0/library/Rcpp/include'        -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign -c RcppExports.cpp -o RcppExports.o
"C:/rtools40/mingw64/bin/"g++ -std=gnu++11  -I"C:/PROGRA~1/R/R-40~1.0/include" -DNDEBUG  -I'C:/Program Files/R/R-4.0.0/library/Rcpp/include'        -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign -c escapeExamples.cpp -o escapeExamples.o
"C:/rtools40/mingw64/bin/"g++ -std=gnu++11  -I"C:/PROGRA~1/R/R-40~1.0/include" -DNDEBUG  -I'C:/Program Files/R/R-4.0.0/library/Rcpp/include'        -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign -c isComplete.cpp -o isComplete.o
"C:/rtools40/mingw64/bin/"g++ -std=gnu++11  -I"C:/PROGRA~1/R/R-40~1.0/include" -DNDEBUG  -I'C:/Program Files/R/R-4.0.0/library/Rcpp/include'        -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign -c leadingSpaces.cpp -o leadingSpaces.o
"C:/rtools40/mingw64/bin/"g++ -std=gnu++11  -I"C:/PROGRA~1/R/R-40~1.0/include" -DNDEBUG  -I'C:/Program Files/R/R-4.0.0/library/Rcpp/include'        -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign -c parser2.cpp -o parser2.o
"C:/rtools40/mingw64/bin/"g++ -std=gnu++11  -I"C:/PROGRA~1/R/R-40~1.0/include" -DNDEBUG  -I'C:/Program Files/R/R-4.0.0/library/Rcpp/include'        -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign -c wrapUsage.cpp -o wrapUsage.o
C:/rtools40/mingw64/bin/g++ -std=gnu++11 -shared -s -static-libgcc -o roxygen2.dll tmp.def RcppExports.o escapeExamples.o isComplete.o leadingSpaces.o parser2.o wrapUsage.o -LC:/PROGRA~1/R/R-40~1.0/bin/x64 -lR
installing to C:/Program Files/R/R-4.0.0/library/00LOCK-roxygen2/00new/roxygen2/libs/x64
** R
** inst
** byte-compile and prepare package for lazy loading
Error in inDL(x, as.logical(local), as.logical(now), ...) : 
  无法载入共享目标对象‘C:/Program Files/R/R-4.0.0/library/Rcpp/libs/x64/Rcpp.dll’::
  LoadLibrary failure:  找不到指定的程序。
Calls: <Anonymous> ... asNamespace -> loadNamespace -> library.dynam -> dyn.load -> inDL
停止执行
ERROR: lazy loading failed for package 'roxygen2'
* removing 'C:/Program Files/R/R-4.0.0/library/roxygen2'
Warning in install.packages :
  installation of package ‘roxygen2’ had non-zero exit status

The downloaded source packages are in
    ‘C:\Users\lijiaxiang\AppData\Local\Temp\RtmpKwxelv\downloaded_packages’

Right, it is actually the Rcpp.dll. You probably have a broken Rcpp package. Reinstall Rcpp first, then install roxygen2.

You are right. I cannot reinstall Rcpp successfully, I will open an issue for Rcpp first.

> install.packages("Rcpp")
试开URL’https://cran.rstudio.com/bin/windows/contrib/4.0/Rcpp_1.0.4.6.zip'
Content type 'application/zip' length 3168145 bytes (3.0 MB)
downloaded 3.0 MB

package ‘Rcpp’ successfully unpacked and MD5 sums checked

The downloaded binary packages are in
    C:\Users\lijiaxiang\AppData\Local\Temp\Rtmpo1AbJn\downloaded_packages
> library(Rcpp)
错误: package or namespace load failed for ‘Rcpp’ in inDL(x, as.logical(local), as.logical(now), ...):
 无法载入共享目标对象‘C:/Program Files/R/R-4.0.0/library/Rcpp/libs/x64/Rcpp.dll’::
  LoadLibrary failure:  找不到指定的程序。
此外: Warning message:
程辑包‘Rcpp’是用R版本4.0.2 来建造的 

I use the latest version of R to 4.0.2, and successfully install Rcpp and roxygen2, thanks for your help a lot to locate the problem.

And from https://github.com/RcppCore/Rcpp/issues/1095#issuecomment-651045475, the @eddelbuettel suggestion, the error does not result from Rcpp but other dependencies of roxygen.

IDK, this does seem to come from Rcpp:

Unable to load shared target object ‘C:/Program Files/R/R-4.0.0/library/Rcpp/libs/x64/Rcpp.dll’::
  LoadLibrary failure: The specified program cannot be found.
In addition: Warning message:
The program package ‘Rcpp’ was built with R version 4.0.2

Can you load Rcpp?

Ah, you already fixed the issue, never mind then. Yeah, so you had a broken Rcpp installation, and re-installing Rcpp fixed the issue.

Yeah, so you had a broken Rcpp installation

Come on now. Please suggest a change, any change, Rcpp could or should make here.

Broken file-locking on Windows is not something we have control over.

IDK, this does seem to come from Rcpp:

Unable to load shared target object ‘C:/Program Files/R/R-4.0.0/library/Rcpp/libs/x64/Rcpp.dll’::
  LoadLibrary failure: The specified program cannot be found.
In addition: Warning message:
The program package ‘Rcpp’ was built with R version 4.0.2

Can you load Rcpp?

@gaborcsardi Yes, I can load Rcpp and roxygen both when I install R 4.0.2 and Rtools 4.
This message also makes me confused. I think it just gives a warning not an error: ‘Rcpp’ was built with R version 4.0.2.

Ah, you already fixed the issue, never mind then. Yeah, so you had a broken Rcpp installation, and re-installing Rcpp fixed the issue.

Yes, based on the new R version hah, 4.0.2. Under R 4.0.0, the error happens still.

@eddelbuettel I am not sure what you mean. A broken installation means that the package on the disk is in a state that cannot be loaded. Historically this is usually a result of https://bugs.r-project.org/bugzilla/show_bug.cgi?id=17478 but there are plenty of other ways, e.g. an interrupted or crashed installation. This happens to all packages with compiled code, on Windows. There is little that you or anyone else but R core can do about it.

@JiaxiangBU Can you try loading Rcpp in R 4.0.0 then? I.e. just type library(Rcpp). If that fails, then just reinstall Rcpp, and then reinstall roxygen.

I appreciate the more explicit language. It is, essentially, a known Windows defect. Pointing at by-stander packages serves no-one.

We both recommended to OP to reinstall, which is the only recourse. Moreover, for packages with such long dependency tails as this, there is little else to do than bisection and trying subsets of the dependency graph.

Moreover, for packages with such long dependency tails as this, there is little else to do than bisection and trying subsets of the dependency graph.

Or reading the error message. :)

Under the R 4.0.0, I cannot load Rcpp, even though I can use command install.packages for Rcpp without error message.

I test this error a lot. I restart the windows machine, open a terminal to open only one session to test. But I still cannot load Rcpp. 

I take the suggestion for @ShotaOchi from https://github.com/RcppCore/Rcpp/issues/1095#issuecomment-650955884 to upgrade R yo 4.0.2.  Then I can load Rcpp.

发自我的iPhone

------------------ Original ------------------
From: Gábor Csárdi <[email protected]>
Date: Mon,Jun 29,2020 11:41 PM
To: r-lib/roxygen2 <[email protected]>
Cc: Jiaxiang Li [email protected]>, Mention <[email protected]>
Subject: Re: [r-lib/roxygen2] Installation ERROR: compilation failed for package 'roxygen2' (#1128)

@eddelbuettel I am not sure what you mean. A broken installation means that the package on the disk is in a state that cannot be loaded. Historically this is usually a result of https://bugs.r-project.org/bugzilla/show_bug.cgi?id=17478 but there are plenty of other ways, e.g. an interrupted or crashed installation. This happens to all packages with compiled code, on Windows. There is little that you or anyone else but R core can do about it.

@JiaxiangBU Can you try loading Rcpp in R 4.0.0 then. I.e. just type library(Rcpp). If that fails, then just reinstall Rcpp, and then re-install roxygen.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or unsubscribe.

Or reading the error message. :)

Do you mean the warning message? ;-)

@eddelbuettel No, this is an error message:

Unable to load shared target object ‘C:/Program Files/R/R-4.0.0/library/Rcpp/libs/x64/Rcpp.dll’::
  LoadLibrary failure: The specified program cannot be found.

@JiaxiangBU Right, I understand now. This is not a broken installation, but something else. I can reproduce this as well on R 4.0.0. Apparently, the Rcpp binary served by CRAN does not work on R 4.0.0.

If you install from source, that seems to fix it:

install.packages("Rcpp", type = "source")

Anyway, very clearly, this is not a roxygen2 issue.

Or, as has been said repeatedly, upgrade to R 4.0.2.

This is a base R ABI change, probably unintended: https://www.mail-archive.com/[email protected]/msg42398.html

Rockstar level debugging by you and @jeroen; I just said thanks to you via DM when I saw your r-devel post (before I saw this).

Was this page helpful?
0 / 5 - 0 ratings