[R] Trying to load a FORTRAN dll but unable

Duncan Murdoch murdoch.duncan at gmail.com
Mon Feb 22 16:47:41 CET 2016


On 22/02/2016 10:24 AM, MAURICE Jean - externe wrote:
> Hi,
> With this piece of code, I get the message 824 :
>
>      deelel <- paste(AccesDLL, "/regr.dll",sep="")
>      if ( ! is.loaded(deelel))

The is.loaded function checks for symbols, not libraries.  See 
?is.loaded for examples.


>      {
>                 dyn.load(deelel)
>                 if ( ! is.loaded(deelel))
>                 {
>                                cat("824 : ", deelel, "non charg�e\n")
>                 }
>      }
>
>
> Am I doing something wrong in this code ?
> If not, what can prevent a DLL to be loaded ? And first is it a problem if the DLL is has been built on a 32bits Windows system and is used on a 64bits windows system ?

It doesn't necessarily matter where it was built, but it definitely does 
matter what the target architecture is.  If you are running 32 bit R, 
you'll see "Platform: i386-w64-mingw32/i386 (32-bit)" in the startup 
banner, and you need a 32 bit DLL.  If you are running 64 bit R, you'll 
see "Platform: x86_64-w64-mingw32/x64 (64-bit)", and you need a 64 bit 
DLL.  32 bit Windows can only run 32 bit R, but 64 bit Windows can run 
either architecture.

Duncan Murdoch



More information about the R-help mailing list