Hello, I see there is a long recent thread about similar issues, but I’ve tried the solutions in that one and none have seemed to work. I have tried to follow steps as best I can, and get no error message when I install rstan using:
I think now my rstan is finally working.
Here is what I did.
Fixed sh: g++ error first.
I did this by changing Makevars.win
from
CXX14 = g++
to
CXX14 = “C:\rtools40\mingw64\bin\g++”
Just changed that one line. Not exactly sure what this is, but it appears that, originally CXX14 was referring to g++ without specifying any directory, but the fix specifies the directory. (I think I saw this from one of the troubleshooting tips from an earlier version of the rtool section.
Then, reinstalled rstan from the source by following this page
Then, it worked.
Before I fix the sh:g++ error, I could not even install from the source. I have seen many people reporting that their errors are solved when installing from the source.
Hope it helps.
Thanks for the help. I actually fixed it yesterday, although I don’t even really know how–I was following along with other threads and I think what I did was delete the Makevars.win file on my computer, restarted R, and then that seemed to fix it? I think that had basically the same effect as what you did.