[Rd] dyn.load inside a package in R >= 3.0

Uwe Ligges ligges at statistik.tu-dortmund.de
Sun Apr 28 16:27:21 CEST 2013



On 24.04.2013 19:55, Adrian Mejia wrote:
> Hello,
> I am trying to port a package that was built for R 2.15 over to R 3.0. This package has an Initialize method that uses dyn.load to load a dll that was built separately, and then uses .C() to make calls on the functions in that dll. This worked fine in 2.15, however, I see that now for 3.0 .C() will only search in the namespace of your current package. This seems to make it impossible to use dyn.load for loading a dll, as I can't find a way to get the loaded dll to belong to the namespace of the package that is using it. It tells me that the function I'm trying to call is not resolved from the current namespace, or if pass the .C function a value for the PACKAGE optional argument it tells me that the symbol is not available for .C() for the package.
> Is there a way to still use dyn.load to use a dll inside my package? Do I need to change the structure of my project to still be able to use my dll?

If you need an example for such an ugly hack, see how we did it in the 
BRugs package.

Best,
Uwe Ligges





> Thanks
> Adrian
>
> 	[[alternative HTML version deleted]]
>
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>



More information about the R-devel mailing list