[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> ?????:
"object '_ade4_RVrandtestCpp' not found").
static const R_CallMethodDef CallEntries[] = {
{"_ade4_RVrandtestCpp", (DL_FUNC) &_ade4_RVrandtestCpp, 3},
{NULL, NULL, 0}
};
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.
Best regards, Ivan