Trouble installing Rtools for rstan


Operating System: Windows 10
Interface Version: R x64 3.4.3 and Rstudio 1.1423 - Windows Vista/7/8/10
Output of writeLines(readLines(file.path(Sys.getenv(“HOME”), “.R/Makevars”))):
Output of devtools::session_info("rstan”):


I’m trying to get Rtools34.exe to play nice with Rstudio 1.1.423 on a Windows 10, and I’m not succeeding.

According to the instructions on, I’m supposed to check a box when I get to the “Select Additional Tasks” prompt. However, I don’t have the same options as the one depicted in the help page. My choices under “Edit Path” are "Current value: PATH = … " or “Save version information to registry”. If I click on the former, then I have the option to edit the path, and the default path is:


Since I don’t have a lot of experience with this, I left it as it was.

In Rstudio, I entered Sys.getenv(‘Path’) and my output is:
[1] “C:\Rtools\bin;C:\Program Files\R\R-3.4.3\bin\x64;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Users\tthalhuber\AppData\Local\Microsoft\WindowsApps;”

I then tried system(‘g++ -v’) and I get:
Warning message:
running command ‘g++ -v’ had status 127

From what I’ve seen from other posts, it looks like my path is having a hard time finding the C++ compiler. I’m not sure where to go from here, so I was wondering if anyone had suggestions.



It looks as if you tried to install the 32bit Rtools on a 64bit system.


So I tried to re-install Rtools 34. During the installation, it gives the option to install both a 32 bit tool chain and a 64 bit tool chain. This time around I went with just the 64 bit tool chain, and the default Path was :


Back on Rstudio, I entered the same Sys.getenv(‘PATH’) and system(‘g++ -v’) commands and got the exact same outputs as before. Is there anything else I should try?


What is




When I enter Sys.getenv(“BINPREF”), I get " ".


Then, you probably skipped the step of

where it says to execute

cat('Sys.setenv(BINPREF = "C:/Rtools/mingw_$(WIN)/bin/")',
    file = file.path(Sys.getenv("HOME"), ".Rprofile"), 
    sep = "\n", append = TRUE)


Which step is that? I’m going off of the instructions on


the #configuration section that is 2 / 3 of the way down the page


So I entered the code in the configuration section. When I run cat(readLines(M), sep = “\n”), my output is CXXFLAGS=-O3 -Wno-unused-variable -Wno-unused-function. Is that supposed to be the output?

When I try system(‘g++ -v’), I still get status 127. What should I try next?