我刚用了Rcpp
Rcpp::sourceCpp('D:\\6_R_tool\\04_track_cluster\\line_cluster_c.cpp')
和错误发生:前几天还能用,今天突然坏了。
我的小行星就是小行星。
C:/PROGRA~1/R/R-40~1.2/etc/x64/Makeconf:244: warning: overriding commands for target `.m.o'
C:/PROGRA~1/R/R-40~1.2/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.2/include" -DNDEBUG -I"C:/Users/justin/Documents/R/win-library/4.0/Rcpp/include" -I"D:/6_R_tool/04_track_cluster" -O2 -Wall -mfpmath=sse -msse2 -mstackrealign -c line_cluster_c.cpp -o line_cluster_c.o
process_begin: CreateProcess(NULL, basename sourceCpp_2.dll .dll, ...) failed.
process_begin: CreateProcess(NULL, basename sourceCpp_2.dll .dll, ...) failed.
process_begin: CreateProcess(NULL, basename sourceCpp_2.dll .dll, ...) failed.
"zline_cluster_c.o" was unexpected at this time.
make: *** [sourceCpp_2.dll] Error 255
Error in Rcpp::sourceCpp("D:\\6_R_tool\\04_track_cluster\\line_cluster_c.cpp") :
Error 1 occurred building shared library.
WARNING: The tools required to build C++ code for R were not found.
Please download and install the appropriate version of Rtools:
http://cran.r-project.org/bin/windows/Rtools/
可能是什么问题,我应该怎么做?
2条答案
按热度按时间hmmo2u0o1#
可通过在
RGui
中键入命令来解决此问题。我注意到路径已经被重置。请参见
Sys.which("make")
。新路径是
"C:\\rtools40\\usr\\bin\\make.exe"
,在我修复这个问题之前,它的值肯定是不同的。但谁能告诉我为什么呢?谢谢。
flvlnr442#
观看此视频https://www.youtube.com/watch?v=hBTObNFFkhs,并确保您得到一个结果,如果有警告,有些东西是不正确的。
另外,在我的例子中,使用Rtools 42。下面是我的新路径:
路径=“C:\r工具42\usr\bin;${路径};C:\程序文件\R\R-4.2.2\库\统计信息\库\x64”
下面是我在R STUDIO控制台上运行的命令
写入行('PATH =“C:\r工具42\usr\bin;${路径};C:\程序文件\R\R-4.2.2\库\统计信息\库\x64“',条件=“~/.Renviron”)