[R] dyn.load() for windows

Duncan Murdoch dmurdoch at pair.com
Fri Jul 9 16:50:18 CEST 2004

On Fri, 9 Jul 2004 03:29:55 -0700 (PDT), Utsav Boobna
<catch_utsav at yahoo.com> wrote :

>I am using Borland C++ compiler 5.5 and R 1.7.1
>got the dll using 
>c:\> bcc32 -u- -6 -O2 -osample.dll -WDE sample.c

I don't know the bcc32 command line options.  Can you examine the
sample.dll file (using e.g. "tdump sample.dll", if you have tdump, or 
"objdump -x sample.dll" using the objdump tool from our tools
collection), and make sure it really is a DLL file?

Once you work out what is necessary to produce a DLL that works,
please write up a short description and send it to me to include on my


I don't think there's anything there now that would help you, but you
might browse it for inspiration...

Duncan Murdoch

>Then in R I used
>> dyn.load("sample.dll")
>Error in dyn.load(x, as.logical(local),
>as.logical(now)) : 
>        unable to load shared library "C:/sample.dll":
>  LoadLibrary failure:  %1 ist keine zulässige
>(Its in German ... meaning "%1 is not a valid Win32
>--- Duncan Murdoch <dmurdoch at pair.com> wrote:
>> On Fri, 9 Jul 2004 01:58:27 -0700 (PDT), Utsav
>> Boobna
>> <catch_utsav at yahoo.com> wrote:
>> >Hi,
>> >   I compiled several C program files on Borland
>> C++
>> >compiler to get one dll output (as instructed in
>> the
>> >file readme.package). Now when I try to load this
>> >*.dll to R using dyn.load(), then the machine gives
>> >the error message "*.dll is not a valid windows
>> >data,....". The out put of R is 
>> >
>> >I am working on win2k.
>> >What could be the possible reason for that?
>> Please show us your code and the exact error message
>> (using cut and
>> paste).  It might also help if you gave an exact
>> description of how
>> you produced the DLL (though I'm not familiar with
>> BC++, someone else
>> might be), and gave version numbers of BC++ and R.
>> Duncan Murdoch
>R-help at stat.math.ethz.ch mailing list
>PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

More information about the R-help mailing list