Error in new_CppObject_xp


#1

I created a simple package with rstantools::rstan_package_skeleton and everytime I use it i get this error:

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

Everything seems to go smoothly after that.

Any suggestion on how to fix that? I get the same error on my Windows 10 computer

Operating System: Linux (docker andrewheiss/tidyverse-rstanarm)
Interface Version: rstan 2.16.2, rstanarm 2.15.3 rstantools 1.3.0
Output of writeLines(readLines(file.path(Sys.getenv(“HOME”), “.R/Makevars”))):
Output of devtools::session_info("rstan”):

Session info -------------------------------------------------
 setting  value                       
 version  R version 3.3.3 (2017-03-06)
 system   x86_64, linux-gnu           
 ui       RStudio (1.0.143)           
 language (EN)                        
 collate  en_US.UTF-8                 
 tz       Etc/UTC                     
 date     2017-10-02                  

Packages -----------------------------------------------------
 package      * version   date       source        
 BH             1.65.0-1  2017-08-24 CRAN (R 3.3.3)
 colorspace     1.3-2     2016-12-14 CRAN (R 3.3.3)
 dichromat      2.0-0     2013-01-24 CRAN (R 3.3.3)
 digest         0.6.12    2017-01-27 CRAN (R 3.3.3)
 ggplot2        2.2.1     2016-12-30 CRAN (R 3.3.3)
 graphics     * 3.3.3     2017-04-24 local         
 grDevices    * 3.3.3     2017-04-24 local         
 grid           3.3.3     2017-04-24 local         
 gridExtra      2.3       2017-09-09 CRAN (R 3.3.3)
 gtable         0.2.0     2016-02-26 CRAN (R 3.3.3)
 inline         0.3.14    2015-04-13 CRAN (R 3.3.3)
 labeling       0.3       2014-08-23 CRAN (R 3.3.3)
 lattice        0.20-35   2017-03-25 CRAN (R 3.3.3)
 lazyeval       0.2.0     2016-06-12 CRAN (R 3.3.3)
 magrittr       1.5       2014-11-22 CRAN (R 3.3.3)
 MASS           7.3-47    2017-04-21 CRAN (R 3.3.3)
 Matrix         1.2-11    2017-08-16 CRAN (R 3.3.3)
 methods      * 3.3.3     2017-04-24 local         
 munsell        0.4.3     2016-02-13 CRAN (R 3.3.3)
 plyr           1.8.4     2016-06-08 CRAN (R 3.3.3)
 R6             2.2.2     2017-06-17 CRAN (R 3.3.3)
 RColorBrewer   1.1-2     2014-12-07 CRAN (R 3.3.3)
 Rcpp           0.12.13   2017-09-28 CRAN (R 3.3.3)
 RcppEigen      0.3.3.3.0 2017-05-01 CRAN (R 3.3.3)
 reshape2       1.4.2     2016-10-22 CRAN (R 3.3.3)
 rlang          0.1.2     2017-08-09 CRAN (R 3.3.3)
 rstan          2.16.2    2017-07-03 CRAN (R 3.3.3)
 scales         0.5.0     2017-08-24 CRAN (R 3.3.3)
 StanHeaders    2.16.0-1  2017-07-03 CRAN (R 3.3.3)
 stats        * 3.3.3     2017-04-24 local         
 stats4         3.3.3     2017-04-24 local         
 stringi        1.1.5     2017-04-07 CRAN (R 3.3.3)
 stringr        1.2.0     2017-02-18 CRAN (R 3.3.3)
 tibble         1.3.4     2017-08-22 CRAN (R 3.3.3)
 tools          3.3.3     2017-04-24 local         
 utils        * 3.3.3     2017-04-24 local         
 viridisLite    0.2.0     2017-03-24 CRAN (R 3.3.3)

#2

Upgrade to rstan 2.16.x.


#3

And do a build with --preclean


#4

I have rstan 2.16.2. I ran R CMD INSTALL --preclean .and the error did not go away. I also tried renaming init.cpp to init.c and running R CMD INSTALL --preclean . again.


#5

I got the fixes mixed up. Actually, you need