0

normcdf() is a function from RcppArmadillo, I can use it successfully from sourceCpp() in command line.

If I am trying to compile my own R package, the compile does not return any error. However, if I am using this function, it returned the following errors.

error: normcdf(): C++11 compiler required

ESCoder
  • 15,431
  • 2
  • 19
  • 42
Mo Li
  • 1
  • 1
  • 2
    Does this answer your question? [Understanding the contents of the Makevars file in R (macros, variables, ~/.R/Makevars and pkg/src/Makevars)](https://stackoverflow.com/questions/43597632/understanding-the-contents-of-the-makevars-file-in-r-macros-variables-r-ma). In your case you have to add CXX_STD = CXX11` to `src/Makevars`. That is the default when generating a package using RcppArmadillo via `RcppArmadillo.package.skeleton()`. – Ralf Stubner Feb 21 '20 at 10:53
  • 1
    Thank you for your help, that do solve the problem. Thanks so much. Ralf Stubner and Dirk Eddelbuettel. – Mo Li Feb 21 '20 at 21:01

0 Answers0