1

I know, the first thing someone is going to say is that this has been solved, there are a zillion links in SO. Link to that solution and I will try it before stating that it does not work. Fairly certain I have tried to ask this before.

Tried: https://cran.r-project.org/bin/windows/Rtools/

I was even able to go through all these steps and it passed, but Files > new project > new directory > new package. Then try to build the template projects results in the endless loop of "Building R Packages requires installation of additional build tools. Do you want to install additional tools now?"

Or this: RStudio not finding RTools

devtools::find_rtools()
TRUE
install.packages("Rcpp")

But I have no c compiler

Sys.which("ls.exe")
returns a path
Sys.which("gcc.exe")
does not return a path

or this: RStudio cannot find Rtools to build package

Added c:\Rtools\mingw_64\bin to my path, no luck.

or this

install::install.Rtools()
no need to install Rtools

Can't find a solution that will work, and I can't build packages until I find a solution.

Sys.which("make.exe")
"C:\\rtools40\\usr\\bin\\make.exe"
tools::Rcmd(c('config', 'CXX11'))
cannot find the specified path

But the only function in this package is (no c code)

hello <- function(){
print('hello world')
}
Harlan Nelson
  • 1,394
  • 1
  • 10
  • 22
  • Which version of R are you using? Which version of RTools did you install? What exactly did you mean by "try to build the template projects"? It's not clear what loop you are stuck in. Exact error messages would be helpful. When you chose "new project", did you just choose "R Package" or did you choose "R Package using Rcpp" or one of the many other choices? – MrFlick Oct 25 '21 at 21:00
  • In RStudio in the dropdown menu for "File" there is an option called "New Project" If that is selected then there is another option for "New Directory". After that is selected, there is an option for "R Package" If that option is selected, then RStudio populates the new directory with the necessary files for a "template" r package. That package should "build". In my case, I am asked to install necessary packages. If I select "yes", that dialogue will finish successfully, but each time I try to "build" I will get the same dialog box with the same question. – Harlan Nelson Oct 25 '21 at 21:55
  • RTools is 4.0. R is at version 4.1. – Harlan Nelson Oct 25 '21 at 21:56
  • Does your package contain any C or C++ code? Normally you only need RTools if you are compiling packages with code from other languages. Does `Sys.which("make.exe")` return a path inside the RTools folder? Does `Sys.getenv("RTOOLS40_HOME")` retun the correct path? Does `tools::Rcmd(c('config', 'CXX11'))` return a path? Do you have an .Renviron file in your home directory? Can you provide the output of the console so we can see exactly what R is doing? What exactly does the message look like when it "finishes successfully"? – MrFlick Oct 25 '21 at 22:07

0 Answers0