I always get these errors when trying to run code from RSTAN/STAN/brms. I have used RStan Getting Started · stan-dev/rstan Wiki · GitHub, and have followed the instructions, but the problem persists.
Compiling Stan program...
Warning in system(paste(CXX, ARGS), ignore.stdout = TRUE, ignore.stderr = TRUE) :
'C:/rtools40/usr/mingw_/bin/g++' not found
make cmd is
make -f "C:/PROGRA~1/R/R-41~1.1/etc/x64/Makeconf" -f "C:/PROGRA~1/R/R-41~1.1/share/make/winshlib.mk" -f "C:/Users/christiana/Documents/.R/Makevars.win" CXX='$(CXX14) $(CXX14STD)' CXXFLAGS='$(CXX14FLAGS)' CXXPICFLAGS='$(CXX14PICFLAGS)' SHLIB_LDFLAGS='$(SHLIB_CXX14LDFLAGS)' SHLIB_LD='$(SHLIB_CXX14LD)' SHLIB="file19b056ff7da.dll" WIN=64 TCLBIN=64 OBJECTS="file19b056ff7da.o"
make would use
Warning message:
In system(paste(cmd, "-n")) :
'CreateProcess' failed to run 'C:\rtools40\usr\bin\make.exe -f "C:/PROGRA~1/R/R-41~1.1/etc/x64/Makeconf" -f "C:/PROGRA~1/R/R-41~1.1/share/make/winshlib.mk" -f "C:/Users/christiana/Documents/.R/Makevars.win" CXX='$(CXX14) $(CXX14STD)' CXXFLAGS='$(CXX14FLAGS)' CXXPICFLAGS='$(CXX14PICFLAGS)' SHLIB_LDFLAGS='$(SHLIB_CXX14LDFLAGS)' SHLIB_LD='$(SHLIB_CXX14LD)' SHLIB="file19b056ff7da.dll" WIN=64 TCLBIN=64 OBJECTS="file19b056ff7da.o" -n'
Error in compileCode(f, code, language = language, verbose = verbose) :
Warning message:In system(cmd) : 'CreateProcess' failed to run 'C:\rtools40\usr\bin\make.exe -f "C:/PROGRA~1/R/R-41~1.1/etc/x64/Makeconf" -f "C:/PROGRA~1/R/R-41~1.1/share/make/winshlib.mk" -f "C:/Users/christiana/Documents/.R/Makevars.win" CXX='$(CXX14) $(CXX14STD)' CXXFLAGS='$(CXX14FLAGS)' CXXPICFLAGS='$(CXX14PICFLAGS)' SHLIB_LDFLAGS='$(SHLIB_CXX14LDFLAGS)' SHLIB_LD='$(SHLIB_CXX14LD)' SHLIB="file19b056ff7da.dll" WIN=64 TCLBIN=64 OBJECTS="file19b056ff7da.o"'
Error in sink(type = "output") : invalid connection
Operating System:R4.1.1, Windows 10
Interface Version:
Compiler/Toolkit: