Dear all,

I have problems loading a library in the 64 version of R.

The following happens:


·         I have a file, equildistC.cpp, which contains a few lines of C++ code.

·         I have compiled the file using the following commands:
PATH =  c:\Rtools\bin;C:\Rtools\gcc-4.6.3\bin;C:\Rtools\gcc-4.6.3\bin64;C:\Rtools\gcc-4.6.3\i686-w64-mingw32;C:\R-2.15.1\bin\i386;C:\R-2.15.1\bin\x64;c:\windows;c:\windows\system32;C:\Windows\SysWOW64
R --arch x64 CMD SHLIB equildistC.cpp

·         I have received no messages indicating problem during compilation, and both the equildistC.o and the equildistC.dll have been created.

·         When I load the dll in the 32bit version of R with dyn.load("C:\\Ccodefortransortmodel\\equildistC.dll"), things appear to go well.

·         However, in the 64 bit version, I get the message:
Error in inDL(x, as.logical(local), as.logical(now), ...) :
  unable to load shared object 'C:/Ccodefortransortmodel/equildistC.dll':
  LoadLibrary failure:  %1 is not a valid Win32 application.


I have googled the error message. Initially I had omitted “--arch x64” when compiling the file, but even after specifying the architecture, the error persists.
However, I definitely need to be able to run my code on the 64 version.


Kind regards
Laurent

________________________________
[http://www.vito.be/e-maildisclaimer/bsds.png] <http://bsds.vito.be>
VITO Disclaimer: http://www.vito.be/e-maildisclaimer

	[[alternative HTML version deleted]]

