[Rd] dyn.load inside a package in R >= 3.0
amejia at factset.com
Thu May 2 14:57:07 CEST 2013
I see that for the x64 architecture a function is used called dyn.open. Is that what puts it in the appropriate namespace? The x86 version uses dyn.load and it doesn't seem to specify a package or namespace.
I can't find any documentation for dyn.open - is it defined somewhere I can't find it?
What would be a less ugly hack for accomplishing this?
From: Uwe Ligges [mailto:ligges at statistik.tu-dortmund.de]
Sent: Sunday, April 28, 2013 10:27 AM
To: Adrian Mejia
Cc: r-devel at r-project.org
Subject: Re: [Rd] dyn.load inside a package in R >= 3.0
On 24.04.2013 19:55, Adrian Mejia wrote:
> 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.
> [[alternative HTML version deleted]]
> R-devel at r-project.org mailing list
More information about the R-devel