Subject:
Re: [ruby-ffi] need help loading a library
From:
Luis Lavena
Date:
4/25/11 2:55 PM
To:
ruby-ffi@googlegroups.com

On Mon, Apr 25, 2011 at 4:50 PM, Chuck Remes <cremes.devlist@mac.com> wrote:
> 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
>

libzmq.dll needs to be in the PATH, try copying that file to Ruby\bin
or adding the directory where libzmq.dll lives to the PATH.

> 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.
>

/usr/local or even /usr/local/lib are not in the PATH.

> 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:
>

.a are linking libraries, are not shared libraries. you got the
expected outcome: failure.

>> 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
>

That is very weird.

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

I haven't invested time in test latest version of zeromq to see why is all this.

Will try once I get home and let you know. At first seems to be that
the generated shared librari (dll) might not be compatible with the
FFI gem, but let's see.
-- Luis Lavena AREA 17 - Perfection in design is achieved not when there is nothing more to add, but rather when there is nothing more to take away. Antoine de Saint-Exupéry