Rcpp Rcpp.package.skeleton(“mypackage”) “rcpp_hello_world” not available for .Call() for package “mypackage”

后端 未结 3 672
夕颜
夕颜 2021-02-05 07:46

I\'ve managed to get the Rcpp.package.skeleton to INSTALL in Windows by the following commands at the R prompt -

Rcpp.package.skeleton(\"mypackage\"         


        
相关标签:
3条回答
  • 2021-02-05 08:00

    FWIW, I just got a similar error while retrofitting an existing R-only package with Rcpp, and the problem was a missing useDynLib(mypackage) in NAMESPACE.

    0 讨论(0)
  • 2021-02-05 08:03

    If the package NAMESPACE file contains the line useDynLib(mypackage, .registration = TRUE) (perhaps via a roxygen line #' @useDynLib, .registration = TRUE), then it is necessary to remove PACKAGE = "mypackage" from .C / .Call function calls:

    i.e. .Call( "rcpp_hello_world", PACKAGE = "mypackage") becomes .Call("rccp_hello_world").

    0 讨论(0)
  • 2021-02-05 08:04

    The package is tested extensively before every release, including on the Windows-using Win-builder. The regression tests even include building a package this way via a call to package.skeleton().

    It is also rebuilt by CRAN post-release. Many people use it.

    For all of those people, tests are appropriate and when long long cannot be used, it is #define-d away.

    Now, you insist on building in a non-standard way: no source I know of recommends calling R CMD INSTALL via system(). I suspect you simply have a $PATH mishap and find another wrong g++ version.

    I would suggest to do what the documentation suggests and run

      R CMD INSTALL mypackage*tar.gz
    

    in a cmd.exe prompt.

    0 讨论(0)
提交回复
热议问题