Skip to content

help for calling a c program in the windows version R

3 messages · gxx4@cwru.edu, Uwe Ligges, Duncan Murdoch

#
Hi, all:

I want to call a c program in the windows version R, so I compiled it in VC to get the dll file and use the command ?dyn.load? to call it in R. There is no error appeared for this command, but when I use the command ? is.loaded? to check, it shows that dll file isn?t be loaded. Does anyone have same experience or know the correct way to do it?

Best wishes,
Guan Xing
5/22/03
#
gxx4 at cwru.edu wrote:
I never used VC (Mingw's gcc is recommended), but I can tell you that
there is some information in .../src/gnuwin32/readme.packages and I
think also in Venables&Ripley (2000): S Programming, Springer (but not
sure about that, since the latter is in my office).

Uwe Ligges
#
On Thu, 22 May 2003 13:33:07 -0400, you wrote:

            
"is.loaded" doesn't check for the DLL, it checks for a particular
entry point in the DLL.  Most likely VC is exporting the function
under a different name than you are searching for, or isn't exporting
it at all.

You can view all the exports in a DLL using the Quick View program
that is distributed with some versions of Windows, or using the
objdump program that's in the development tools put together by Brian
Ripley, or using some tool that probably comes with VC.  (With Borland
compilers the tool is called tdump.exe, but I don't know what
Microsoft calls it.)

More help on using DLLs is on my web page,
<http://www.stats.uwo.ca/faculty/murdoch/software/compilingDLLs> and
in the readme.packages file distributed with R.

Duncan Murdoch