From s.boehringer at lumc.nl  Mon Sep 16 16:12:39 2013
From: s.boehringer at lumc.nl (Stefan Boehringer)
Date: Mon, 16 Sep 2013 16:12:39 +0200
Subject: [Rd] Rcpp modules
Message-ID: <523711D7.2060406@lumc.nl>

Dear all,

my apologies for posting here instead of rcpp-devel (registration for
which did not seem to work). I try to use a Rcpp module outside a
package using the following code which should work according to posts on
this list/rcpp-devel.

library('Rcpp');
dlr = dyn.load('build/libtestlib.so');
mod = Module('testclass', PACKAGE = dlr);
cl = new(mod$testclass);

This results in the error message:
Failed to initialize module pointer: Error in
FUN("_rcpp_module_boot_testclass"[[1L]], ...): no such symbol
_rcpp_module_boot_testclass in package
/home/pingu/src/2013-rcpp-test/rcpptest/build/libtestlib.so

Passing the PACKAGE argument above reportedly should solve this error
but does not seem to do so in my setup. Any suggestion appreciated. The
mentioned symbol exists in the shared object file which is linked agains
libR and libRcpp. Both a build with R CMD SHLIB and/or standard cmake
gives the same result.

Environment:
Linux
R 3.0.1
Rcpp_0.10.4
Freshly compiled from source.

Thanks in advance,

    Stefan



[Rd] Rcpp modules
Stefan Boehringer