Skip to content
Prev 8129 / 12125 Next

[R-pkg-devel] moving from C to C++ with Rcpp in R package

? Thu, 2 Jun 2022 15:06:44 +0200
THIOULOUSE JEAN <Jean.Thioulouse at univ-lyon1.fr> ?????:
Almost there. Since you're using the fixes = 'C_' argument to
useDynLib, you need to .Call() the variable called C__ade4_RVrandtestCpp
in your R code, not _ade4_RVrandtestCpp.

You can verify the symbol name by installing the package and searching
for it in the package namespace:

grep(
 'rv.*randtest', ls(loadNamespace('ade4'), all = TRUE),
 ignore.case = TRUE, value = TRUE
)

Unfortunately, this means editing RcppExports.R, which (I think)
prevents you from enjoying the way Rcpp::compileAttributes() sets
everything up for you.