Subject:
[ruby-ffi] need help loading a library
From:
Chuck Remes
Date:
4/25/11 2:50 PM
To:
ruby-ffi

I'm trying to get my ffi-rzmq gem running on Windows (Windows 7 x64). Using DevKit from the RubyInstaller project I was able to successfully build a 32-bit version of the zeromq library. I created a /c/usr/local path and installed the library to that location. Additionally, I installed the ffi gem with 'ruby -S gem install ffi --platform=ruby' where ruby is 1.9.1-p430 so that it would be built using DevKit.

When I tried to require the ffi-rzmq gem, it failed on the call to #ffi_lib. The errors are listed in the pastie.

https://gist.github.com/941051

At /usr/local/lib there is a file named libzmq.dll.a and libzmq.la. I tried copying the *dll* file to the local working directory and trying again. It didn't work and complained about not being able to find the file.

On a lark I renamed libzmq.dll.a to libzmq.dll and tried again. This time it found the library file but Windows throws up a dialog box with the following text:

> z:\mygit\ffi-rzmq\examples\libzmq.DLL is either not designed to run on Windows or it contains an error. Try installing the program again using the original installation media or contact your system administrator or the software vendor for support.



I also tried it with JRuby 1.5.5. It's output is here at https://gist.github.com/941074

I tried it with libzmq.dll.a and renamed to libzmq.dll. It didn't work either way but it also did not throw up the warning box like MRI did.

What am I doing wrong here? Any suggestions for further troubleshooting this issue?

cr