I use “stan(file = “stan_file.stan”, data = stan_data)” to fit my model, and get below error message:
Error in compileCode(f, code, language = language, verbose = verbose) : Compilation ERROR, function(s)/method(s) not created! g++.exe: error: Files/R/R-3.6.1/library/StanHeaders/include/stan/math/prim/mat/fun/Eigen.hpp: No such file or directory g++.exe: error: Files/R/R-3.6.1/library/StanHeaders/include: No such file or directory g++.exe: error: Files/R/R-3.6.1/library/RcppEigen/include: No such file or directory make: *** [C:/PROGRA~1/R/R-36~1.1/etc/x64/Makeconf:215: file349c24c34393.o] Error 1
But I can find these files, I try to unistall R and Rstudio and reinstall them, I tried R 3.6.1 and R 3.6.3, it does not work.
I had this exact problem yesterday after doing a fresh R, rtools and rstan install on a new windows machine. The issue for me (and I suspect it’s the same here) is that I had R installed in Program Files:
This was an issue with the StanHeaders version getting ahead of the RStan version on CRAN, since some of the file paths changed between the two versions. It’s since been reverted but CRAN is still providing the 2.21 binaries. To fix this you need to reinstall the packages from source: