Short summary of the problem
When I run this code:
banova <-brm(differenceinfavorabilityscore ~ group, anova2, prior=c(set_prior("normal(0,2.06)", class= "b")), cores= 4)
I get this error message:
## WARNING: Rtools is required to build R packages, but is not currently installed.
##
## Please download and install the appropriate version of Rtools for 4.5.1 from
## https://cran.r-project.org/bin/windows/Rtools/.
## Trying to compile a simple C file
## Running "C:/PROGRA~1/R/R-45~1.1/bin/x64/Rcmd.exe" SHLIB foo.c
## using C compiler: 'gcc.exe (GCC) 14.2.0'
## gcc -I"C:/PROGRA~1/R/R-45~1.1/include" -DNDEBUG -I"C:/Users/Julie/AppData/Local/R/win-library/4.5/Rcpp/include/" -I"C:/Users/Julie/AppData/Local/R/win-library/4.5/RcppEigen/include/" -I"C:/Users/Julie/AppData/Local/R/win-library/4.5/RcppEigen/include/unsupported" -I"C:/Users/Julie/AppData/Local/R/win-library/4.5/BH/include" -I"C:/Users/Julie/AppData/Local/R/win-library/4.5/StanHeaders/include/src/" -I"C:/Users/Julie/AppData/Local/R/win-library/4.5/StanHeaders/include/" -I"C:/Users/Julie/AppData/Local/R/win-library/4.5/RcppParallel/include/" -DRCPP_PARALLEL_USE_TBB=1 -I"C:/Users/Julie/AppData/Local/R/win-library/4.5/rstan/include" -DEIGEN_NO_DEBUG -DBOOST_DISABLE_ASSERTS -DBOOST_PENDING_INTEGER_LOG2_HPP -DSTAN_THREADS -DUSE_STANC3 -DSTRICT_R_HEADERS -DBOOST_PHOENIX_NO_VARIADIC_EXPRESSION -D_HAS_AUTO_PTR_ETC=0 -include "C:/Users/Julie/AppData/Local/R/win-library/4.5/StanHeaders/include/stan/math/prim/fun/Eigen.hpp" -std=c++1y -I"C:/rtools45/x86_64-w64-mingw32.static.posix/include" -O2 -Wall -std=gnu2x -mfpmath=sse -msse2 -mstackrealign -c foo.c -o foo.o
## cc1.exe: warning: command-line option '-std=c++14' is valid for C++/ObjC++ but not for C
## In file included from C:/Users/Julie/AppData/Local/R/win-library/4.5/RcppEigen/include/Eigen/Core:19,
## from C:/Users/Julie/AppData/Local/R/win-library/4.5/RcppEigen/include/Eigen/Dense:1,
## from C:/Users/Julie/AppData/Local/R/win-library/4.5/StanHeaders/include/stan/math/prim/fun/Eigen.hpp:22,
## from <command-line>:
## C:/Users/Julie/AppData/Local/R/win-library/4.5/RcppEigen/include/Eigen/src/Core/util/Macros.h:679:10: fatal error: cmath: No such file or directory
## 679 | #include <cmath>
## | ^~~~~~~
## compilation terminated.
## make: *** [C:/PROGRA~1/R/R-45~1.1/etc/x64/Makeconf:289: foo.o] Error 1
## WARNING: Rtools is required to build R packages, but is not currently installed.
##
## Please download and install the appropriate version of Rtools for 4.5.1 from
## https://cran.r-project.org/bin/windows/Rtools/.
I do have RTools installed, though - the latest version, installed to the default directory C:\rtools45.
After this error, the code keeps running anyway. I’m not quite getting the results I expected, but I think that’s an entirely different issue. I’d still like to get rid of this error.
I searched the forums and found identical threads from many Mac users, but no Windows users. (There’s one similar but not identical Windows problem 5 years ago…) The solutions in those threads were all Mac-specific.
Operating System: Windows 11 Pro, Version 24H2, Build 26100.4652
R version 4.5.1
RStudio version 2025.05.1 Build 513
RTools version 4.5
brms version 2.22.0
This is also my personal computer at home - no admin rights issues, network drives, permissions, etc.
When I run
pkgbuild::check_build_tools(debug = TRUE)
it passes the check, and says “Your system is ready to build packages!”
Any ideas? Thank you so much!!