[R] Loading a dynamic library

Astle, William J william.astle at imperial.ac.uk
Thu May 19 19:52:49 CEST 2005


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.  

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]

And R hangs. 

Any help appreciated.

Thanks.

Will

_____________________________________________________________

William Astle.
PhD Student,
Department of Epidemiology and Public Health,
Imperial College London,
St Mary's Hospital Campus,
Norfolk Place,
Paddington.
W2 1NY.

wja [at] ic [dot] ac [dot] uk




More information about the R-help mailing list