I rebuilt the package I'm developing (and that I haven't been updating since one month) and I found that all my tests fail with the error:
Error in myCPlusPlusFun(... :
object 'myPackage_myCPlusPlusFun' not found
I then found out that the argument PACKAGE = myPackage
is missing from all the functions in my RcppExports.R
file, see the output of git diff
:
myCPlusPlusFun <- function(X) {
- invisible(.Call('myPackage_myCPlusPlusFun', PACKAGE = 'myPackage', X))
+ invisible(.Call(myPackage_myCPlusPlusFun, X))
Any idea of what happened? I guess I would need to have the
invisible(.Call('myPackage_myCPlusPlusFun', PACKAGE = 'myPackage', X))
line generated again automatically when I build my package (?)
Thank you!
EDIT: I now have the following lines in my NAMESPACE
file:
exportPattern("^[[:alpha:]]+")
importFrom(Rcpp,evalCpp)
useDynLib(locus, .registration = TRUE)
(plus some other imports
and exports
).
I also had to add recently a C file to register dynamics symbols with the following content:
#include <R.h>
#include <Rinternals.h>
#include <R_ext/Rdynload.h>
void R_init_myPackage(DllInfo* info) {
R_registerRoutines(info, NULL, NULL, NULL, NULL);
R_useDynamicSymbols(info, TRUE);
}
is this latter file still needed?