I run R-4.1.2 on a Windows 10 system with R-Studio 2022.12.0. I wanted to update several R packages, but some of them need to be compiled from source. I use Rtools 4.0 for some time now and never had any problems.
With install.packages("ranger", type = "source")
I initiated the update, and after many compiler messages the process stopped with an error, and I read:
"C:/rtools40/mingw32/bin/"g++ -std=gnu++11 -I"C:/R-41~1.2/include" -DNDEBUG -DR_BUILD -DWIN_R_BUILD -I'C:/R-4.1.2/library/Rcpp/include' -I'C:/BITrusted/R-4.1.2/library/RcppEigen/include' -O2 -Wall -mfpmath=sse -msse2 -mstackrealign -c Forest.cpp -o Forest.o
Forest.cpp: In member function 'std::unique_ptr<ranger::Data> ranger::Forest::loadDataFromFile(const string&)':
Forest.cpp:850:19: error: 'make_unique' is not a member of 'std'
result = std::make_unique<DataDouble>();
^~~~~~~~~~~
Forest.cpp:850:19: note: 'std::make_unique' is defined in header '<memory>'; did you forget to '#include <memory>'?
Forest.cpp:26:1:
+#include <memory>
Forest.cpp:850:19:
result = std::make_unique<DataDouble>();
It looks like some dependencies don't match. make_unique
is defined in unique_ptr.h
, but I don't know how to make Rtools import this header.
I reinstalled Rtools, checked the system variables, run from console and R-Studio. Any ideas?
I should mention, that there are only a few packages that show me this error. Many others were compiled without any problems.