[R] Loading a dynamic library

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


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

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.




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

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

More information about the R-help mailing list