Skip to content

Loading a dynamic library

2 messages · Astle, William J, Brian Ripley

#
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,
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
#
On Thu, 19 May 2005, Astle, William J wrote:

            
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.
What is `dynload', and what does [HRT] mean?
Are you sure?  It is more likely that your DLL's initialization code 
hangs.