Re: [R] Loading a dynamic library

From: Prof Brian Ripley <ripley_at_stats.ox.ac.uk>
Date: Fri 20 May 2005 - 06:11:03 EST

On Thu, 19 May 2005, Astle, William J wrote:

> Hi,
>
> I'm trying to load a .dll library into R 2.1.0 on Windows using the
> "dyn.load" function. The library is compiled with gcc 3.3.3 on cygwin
> 1.5.16.

Please use the correct OS's DLLs: Cygwin is another OS hosted on Windows. This might work, but it is not as good an idea as using the recommended compilers, or indeed any other Windows compiler.

> I compile and link:
>
> $ gcc -c myfile.cpp -o myfile.o [HRT]
> $ gcc -shared myfile.o -o myfile.dll [HRT]
>
> I then type, in the R console,
>
>> dynload("myfile.dll")[HRT]

What is `dynload', and what does [HRT] mean?

> And R hangs.

Are you sure? It is more likely that your DLL's initialization code hangs.

-- 
Brian D. Ripley,                  ripley@stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Received on Fri May 20 06:19:22 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:31:55 EST