Warning messages on example(stan_model, package = "rstan", run.dontrun = TRUE)

I run received following warning messages after running the code:

example(stan_model, package = "rstan", run.dontrun = TRUE)

Warning messages:
1: In system(paste(CXX, ARGS), ignore.stdout = TRUE, ignore.stderr = TRUE) :
‘C:/rtools40/usr/mingw_/bin/g++’ not found
2: In readLines(file.path(makevar_files)) :
incomplete final line found on ‘C:/Users/nmura~/Documents/.R/Makevars.win’
3: In readLines(old_path) :
incomplete final line found on ‘C:/Users/nmura~/Documents/.R/Makevars.win’

Wondering if it should be fixed and how.

Welcome to the Stan forums! If the model ran successfully then I think all these warnings can safely be ignored.

This one should go away when we release the next version RStan but I don’t know if you can avoid it before then (it shouldn’t harm anything though).

For some reason R aggressively warns about incomplete final lines in files even though it doesn’t seem to affect anything. Based on the message, I think you can get rid of the warning by going into the file at


and just adding an extra blank line at the end of it.