我有一个带有 Rcpp 代码的 R 包。在任何 linux 发行版中构建良好。问题是在 Windows 中构建它。我的设置中有以下内容
- R 版本 4.0.1 (2020-06-06)
- Windows 10 专业版 1903 版
- Rtools 4.0 安装在
C:\rtools40
这是 Rgui 的输出:
> utils:::menuInstallLocal()
Warning in untar2(tarfile, files, list, exdir, restore_times) :
skipping pax global extended headers
* installing *source* package 'mansched' ...
** using staged installation
** libs
C:/PROGRA~1/R/R-40~1.1/etc/x64/Makeconf:244: warning: overriding commands for target `.m.o'
C:/PROGRA~1/R/R-40~1.1/etc/x64/Makeconf:237: warning: ignoring old commands for target `.m.o'
"C:/rtools40/mingw64/bin/"g++ -std=gnu++11 -I"C:/PROGRA~1/R/R-40~1.1/include" -DNDEBUG -I'D:/Users/USER/Documents/R/win-library/4.0/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.1/include" -DNDEBUG -I'D:/Users/USER/Documents/R/win-library/4.0/Rcpp/include' -O2 -Wall -mfpmath=sse -msse2 -mstackrealign -c assignPool.cpp -o assignPool.o
"C:/rtools40/mingw64/bin/"g++ -std=gnu++11 -I"C:/PROGRA~1/R/R-40~1.1/include" -DNDEBUG -I'D:/Users/USER/Documents/R/win-library/4.0/Rcpp/include' -O2 -Wall -mfpmath=sse -msse2 -mstackrealign -c assignemp.cpp -o assignemp.o
"C:/rtools40/mingw64/bin/"g++ -std=gnu++11 -I"C:/PROGRA~1/R/R-40~1.1/include" -DNDEBUG -I'D:/Users/USER/Documents/R/win-library/4.0/Rcpp/include' -O2 -Wall -mfpmath=sse -msse2 -mstackrealign -c assignmh.cpp -o assignmh.o
"C:/rtools40/mingw64/bin/"g++ -std=gnu++11 -I"C:/PROGRA~1/R/R-40~1.1/include" -DNDEBUG -I'D:/Users/USER/Documents/R/win-library/4.0/Rcpp/include' -O2 -Wall -mfpmath=sse -msse2 -mstackrealign -c gethours.cpp -o gethours.o
"C:/rtools40/mingw64/bin/"g++ -std=gnu++11 -I"C:/PROGRA~1/R/R-40~1.1/include" -DNDEBUG -I'D:/Users/USER/Documents/R/win-library/4.0/Rcpp/include' -O2 -Wall -mfpmath=sse -msse2 -mstackrealign -c getmin.cpp -o getmin.o
"C:/rtools40/mingw64/bin/"g++ -std=gnu++11 -I"C:/PROGRA~1/R/R-40~1.1/include" -DNDEBUG -I'D:/Users/USER/Documents/R/win-library/4.0/Rcpp/include' -O2 -Wall -mfpmath=sse -msse2 -mstackrealign -c isreg.cpp -o isreg.o
"C:/rtools40/mingw64/bin/"g++ -std=gnu++11 -I"C:/PROGRA~1/R/R-40~1.1/include" -DNDEBUG -I'D:/Users/USER/Documents/R/win-library/4.0/Rcpp/include' -O2 -Wall -mfpmath=sse -msse2 -mstackrealign -c isrf.cpp -o isrf.o
"C:/rtools40/mingw64/bin/"g++ -std=gnu++11 -I"C:/PROGRA~1/R/R-40~1.1/include" -DNDEBUG -I'D:/Users/USER/Documents/R/win-library/4.0/Rcpp/include' -O2 -Wall -mfpmath=sse -msse2 -mstackrealign -c mhdb.cpp -o mhdb.o
"C:/rtools40/mingw64/bin/"g++ -std=gnu++11 -I"C:/PROGRA~1/R/R-40~1.1/include" -DNDEBUG -I'D:/Users/USER/Documents/R/win-library/4.0/Rcpp/include' -O2 -Wall -mfpmath=sse -msse2 -mstackrealign -c normemp.cpp -o normemp.o
"C:/rtools40/mingw64/bin/"g++ -std=gnu++11 -shared -s -static-libgcc -o mansched.dll tmp.def RcppExports.o assignPool.o assignemp.o assignmh.o gethours.o getmin.o isreg.o isrf.o mhdb.o normemp.o -LC:/PROGRA~1/R/R-40~1.1/bin/x64 -lR
/usr/bin/sh: line 8: "C:/rtools40/mingw64/bin/"g++ -std=gnu++11 : No such file or directory
no DLL was created
ERROR: compilation failed for package 'mansched'
* removing 'D:/Users/USER/Documents/R/win-library/4.0/mansched'
Warning message:
In install.packages(files[tarballs], .libPaths()[1L], repos = NULL, :
installation of package ‘d:/Users/USER/Downloads/mansched-nocxx.tar.gz’ had non-zero exit status
由于该目录存在,因此该错误/usr/bin/sh: line 8: "C:/rtools40/mingw64/bin/"g++ -std=gnu++11 : No such file or directory
没有意义。