Error under Windows/JRuby
Trying to use ffi-msgpack on Windows (XP Pro SP3).
Ruby: jruby 1.6.1 (ruby-1.8.7-p330) (2011-04-12 85838f6) (Java HotSpot(TM) Client VM 1.6.0_20) [Windows XP-x86-java] Gem: ffi-msgpack (0.2.0) Msgpack lib: 0.5.4, built following instructions here: http://wiki.msgpack.org/display/MSGPACK/QuickStart+for+C+Language
On require 'ffi/msgpack', everything explodes with the following backtrace:
C:\Dev\p2\gate\clients>jruby --1.9 bin/swing_gui LoadError: Could not open library 'msgpack' : The operation completed successfully. . Could not open library 'msgpack.dll' : The operation completed successfully.
ffi_lib at C:/Documents and Settings/bez/.pik/rubies/JRuby-161/lib/ruby/site_ruby/shared/ffi/library.rb:28
collect at org/jruby/RubyArray.java:2344
ffi_lib at C:/Documents and Settings/bez/.pik/rubies/JRuby-161/lib/ruby/site_ruby/shared/ffi/library.rb:10
MsgPack at C:/Documents and Settings/bez/.pik/rubies/JRuby-161/lib/ruby/gems/1.8/gems/ffi-msgpack-0.2.0/lib/ffi/msgpack/msgpack.rb:11
FFI at C:/Documents and Settings/bez/.pik/rubies/JRuby-161/lib/ruby/gems/1.8/gems/ffi-msgpack-0.2.0/lib/ffi/msgpack/msgpack.rb:8
(root) at C:/Documents and Settings/bez/.pik/rubies/JRuby-161/lib/ruby/gems/1.8/gems/ffi-msgpack-0.2.0/lib/ffi/msgpack/msgpack.rb:7
require at org/jruby/RubyKernel.java:1047
(root) at C:/Documents and Settings/bezrodnykh/.pik/rubies/JRuby-161/lib/ruby/gems/1.8/gems/ffi-msgpack-0.2.0/lib/ffi/msgpack/msgpack.rb:1
require at org/jruby/RubyKernel.java:1047
(root) at C:/Documents and Settings/bezrodnykh/.pik/rubies/JRuby-161/lib/ruby/gems/1.8/gems/ffi-msgpack-0.2.0/lib/ffi/msgpack.rb:2
require at org/jruby/RubyKernel.java:1047
(root) at Y:/Dev/p2/gate/clients/lib//clients/zmq_adapter/protocol.rb:2 (THIS is 'require "ffi/msgpack"')
initialize at Y:/Dev/p2/gate/clients/lib//clients/configurable_client.rb:41
(root) at bin/swing_gui:16
The thing is (if I get it right), it is looking for .dll, but msgpack project only builds .lib - which is on the path, of course, but it doesn't help :(
Ah yes, ffi gem is: ffi (1.0.7 java)
I would also report this to upstream msgpack. They need to build a proper DLL for Windows.
So, that .lib file that is built by msgpack is not usable via ffi?
Reported this upstream: https://github.com/msgpack/msgpack/issues/53
It turns out that .lib files on Windows are analogous to .a static libraries on UNIX. So definitely not dynamically loadable by Windows.