Error in new_Cppobjects_xp

Operating System:Windows 7 or 10
Interface Version: rstan (Version 2.16.2
Compiler/Toolkit:

Hi, I’m new to Stan. Installed to Windows 7 and 10 as described in https://github.com/stan-dev/rstan/wiki/Installing-RStan-on-Windows and everything worked as described with Rtools. When opening libraries either rstan or rstanarm we are argued to run

rstan_options(auto_write = TRUE)
options(mc.cores = parallel::detectCores())
and when I do that and start my model - after a short while I get the announcement that 
#Error in new_CppObject_xp(fields$.module, fields$.pointer, ...) : 
 # no valid constructor available for the argument list
#trying deprecated constructor; please alert package maintainer
and the model exits

When I start all over again but omitting these two calls to options and cores, the model runs OK but slowly.
I did not follow the suggestion to have makevars and the other optional stuff under “configuration” - so I did not make any error there :-)

So what do I do?
Best wishes
Troels

[edit: escaped code]

Did you try the options independently to check which one causes the problem or whether it’s only the interaction?

I think you have an incompletely installed rstan. I would suggest starting a clean R session and doing

folder <- system.file(package = "rstan")
remove.packages("rstan")

then verify that everything is gone when you do

dir(folder, recursive = TRUE)

If there is anything remaining, you need to manually delete that folder using the operating system. Finally, restart R and do

install.packages("rstan")

again.

It occurs with either alone ot together. As suggested I reinstalled
rstan to no avail and also reinstalled rstanarm.

Here is then the roaster example

library(rstan)
library(rstanarm)
rstan_options(auto_write=TRUE)
options(mc.cores=parallel::detectCores())

post <- stan_gamm4(y ~ s(roach1) + treatment + log(roaches$exposure2),
random = ~(1 | senior),
data = roaches, family = neg_binomial_2, QR = TRUE,
chains = 10, cores = 10, seed = 1234)

Error in new_CppObject_xp(fields$.module, fields$.pointer, …) :
no valid constructor available for the argument list
trying deprecated constructor; please alert package maintainer

But now, even without the
rstan_options(auto_write=TRUE)
options(mc.cores=parallel::detectCores()) the same error occurs but the
program runs OK but slowly - avoiding the two said lines and avoiding
cores and chains doesn’t take the error away.
But, running the shools8 example with the lines included and also
rstanarm called runs without eliciting the message about calling the
maintainer:-)

Thanks a lot and best wishes
Troels

Okay, if it is executing then don’t worry about the message that says trying deprecated constructor; please alert package maintainer. That is known to not be a problem.