Error in compileCode(f, code, language = language, verbose = verbose) : C:/rtools42/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.3.0/../../../../

When i try to follow the instructions for installation of rstan i keep getting this error when i run
example(stan_model, package = “rstan”, run.dontrun = TRUE).
I have tried restarting r and pass in install.packages(c(“StanHeaders”,“rstan”),type=“source”) as instructed here
RStan Getting Started · stan-dev/rstan Wiki · GitHub

But it dosen’t work

See the Getting Started guide