[Rcpp-devel] Rcpp Modules - Failed to initialize module pointer

schattenpflanze at arcor.de schattenpflanze at arcor.de
Sat Apr 9 14:11:05 CEST 2011


Hello,

I would like to use the very nice Rcpp (0.9.3) Module feature to expose 
C++ functions to R. As a starting point, I tried to get the "testmod" 
package, created with
  Rcpp.package.skeleton( "testmod", module = TRUE )
to run. I can compile and install the package without errors on R 
2.14.0, Suse Linux 11.3. However, when I try to use the module, I get 
the following output:

> require(Rcpp)
Lade nötiges Paket: Rcpp
> library(testmod)
Attaching package: ‘testmod’
The following object(s) are masked _by_ ‘.GlobalEnv’: yada
> yada
Uninitialized module named "yada" from package ".GlobalEnv"
> yada <- Module( "yada" )
> yada$foo( 1,2 )
  Fehler in Module(module, mustStart = TRUE) :
  Failed to initialize module pointer: Error in
  FUN("_rcpp_module_boot_yada"[[1L]], ...): no such symbol
  _rcpp_module_boot_yada in package .GlobalEnv

I have seen the previous thread on a similar error, and I suppose the 
error is related to Section 3 of the Rcpp-modules vignette. The 
.onLoad() routine, however, is already present in the testmod package. I 
have also tried to replace the contents of zzz.R with the code given in 
Section 3.1.1 of the vignette (using populate()), with the same result. 
What do the error messages above actually mean and what am I missing here?

Best regards,
Peter


More information about the Rcpp-devel mailing list