[Rcpp-devel] [Rd] Newbie Rccp module question. "Failed to initialize module pointer"???

Tim Triche, Jr. tim.triche at gmail.com
Fri Feb 18 17:15:39 CET 2011


Cool!

 I was going to ask this exact question ("WTF WHERE IS MY
MODULE$FUNC()?!?!?!!1") and now the magical mailing list has come to the
rescue, unbidden.  Thank you both,

--tim


On Fri, Feb 18, 2011 at 7:10 AM, Dirk Eddelbuettel <edd at debian.org> wrote:

>
> Andre,
>
> (Now just on rcpp-devel)
>
> I had another quick look at this yesterday and noticed
>
> On 17 February 2011 at 13:14, Dirk Eddelbuettel wrote:
> | On 17 February 2011 at 10:29, Andre Zege wrote:
> | | I then run Rcpp.package.skeleton("mypackage"), put fun.cpp in
> mypackage/src and
> | | did
>
> That is not enough. You have to actually get the symbols of your Module
> loaded at package load, typically via function .onLoad() in R/zzz.R -- see
> the Section 3 of the Rcpp-modules vignette entitled 'Using modules in other
> packages'. It lists the populate() helper function, you can also it by hand
> as the Rcpp.package.skeleton() generated code does:
>
> .onLoad <- function(pkgname, libname){
>        # load the module and store it in our namespace
>        unlockBinding( "yada" , .NAMESPACE )
>        assign( "yada",  Module( "yada" ), .NAMESPACE )
>        lockBinding( "yada", .NAMESPACE )
> }
>
> You'd have to do the same for your test module.
>
> Dirk
>
> --
> Dirk Eddelbuettel | edd at debian.org | http://dirk.eddelbuettel.com
> _______________________________________________
> Rcpp-devel mailing list
> Rcpp-devel at lists.r-forge.r-project.org
> https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel
>



-- 
If people do not believe that mathematics is simple, it is only because they
do not realize how complicated life is.
John von Neumann<http://www-groups.dcs.st-and.ac.uk/~history/Biographies/Von_Neumann.html>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/rcpp-devel/attachments/20110218/435e9e69/attachment.htm>


More information about the Rcpp-devel mailing list