chuckremes / ffi-rzmq

FFI bindings for ZeroMQ so the library can be used under JRuby and other FFI-compliant ruby runtimes
242 stars 62 forks source link

FFI::NotFoundError: Function 'zmq_ctx_new' not found in [libzmq.so] #112

Closed mistergibson closed 9 years ago

mistergibson commented 10 years ago

I'm using JRuby 1.7.12

Reproducing the error:

require 'ffi-rzmq' FFI::NotFoundError: Function 'zmq_ctx_new' not found in [libzmq.so] from /opt/jruby-1.7.12/lib/ruby/shared/ffi/library.rb:241:in attach_function' from /opt/jruby-1.7.12/lib/ruby/gems/shared/gems/ffi-rzmq-core-1.0.3/lib/ffi-rzmq-core/libzmq.rb:76:inLibZMQ' from /opt/jruby-1.7.12/lib/ruby/gems/shared/gems/ffi-rzmq-core-1.0.3/lib/ffi-rzmq-core/libzmq.rb:6:in (root)' from org/jruby/RubyKernel.java:1065:inrequire' from /opt/jruby-1.7.12/lib/ruby/shared/rubygems/core_ext/kernel_require.rb:55:in require' from /opt/jruby-1.7.12/lib/ruby/shared/rubygems/core_ext/kernel_require.rb:53:inrequire' from /opt/jruby-1.7.12/lib/ruby/gems/shared/gems/ffi-rzmq-core-1.0.3/lib/ffi-rzmq-core.rb:1:in (root)' from org/jruby/RubyKernel.java:1065:inrequire' from /opt/jruby-1.7.12/lib/ruby/gems/shared/gems/ffi-rzmq-core-1.0.3/lib/ffi-rzmq-core.rb:3:in (root)' from /opt/jruby-1.7.12/lib/ruby/shared/rubygems/core_ext/kernel_require.rb:1:in(root)' from org/jruby/RubyKernel.java:1065:in require' from /opt/jruby-1.7.12/lib/ruby/shared/rubygems/core_ext/kernel_require.rb:55:inrequire' from /opt/jruby-1.7.12/lib/ruby/gems/shared/gems/ffi-rzmq-2.0.1/lib/ffi-rzmq.rb:66:in (root)' from org/jruby/RubyKernel.java:1101:ineval' from /opt/jruby-1.7.12/lib/ruby/shared/rubygems/core_ext/kernel_require.rb:1:in (root)' from /opt/jruby-1.7.12/lib/ruby/shared/rubygems/core_ext/kernel_require.rb:135:inrequire' from (irb):1:in evaluate' from org/jruby/RubyKernel.java:1501:inloop' from org/jruby/RubyKernel.java:1264:in catch' from org/jruby/RubyKernel.java:1264:incatch' from /usr/bin/jirb:13:in `(root)'

chuckremes commented 10 years ago

What version of zeromq do you have installed?

On Jun 20, 2014, at 10:06 PM, mistergibson notifications@github.com wrote:

I'm using JRuby 1.7.12

Reproducing the error:

require 'ffi-rzmq' FFI::NotFoundError: Function 'zmq_ctx_new' not found in [libzmq.so] from /opt/jruby-1.7.12/lib/ruby/shared/ffi/library.rb:241:in attach_function' from /opt/jruby-1.7.12/lib/ruby/gems/shared/gems/ffi-rzmq-core-1.0.3/lib/ffi-rzmq-core/libzmq.rb:76:inLibZMQ' from /opt/jruby-1.7.12/lib/ruby/gems/shared/gems/ffi-rzmq-core-1.0.3/lib/ffi-rzmq-core/libzmq.rb:6:in (root)' from org/jruby/RubyKernel.java:1065:inrequire' from /opt/jruby-1.7.12/lib/ruby/shared/rubygems/core_ext/kernel_require.rb:55:in require' from /opt/jruby-1.7.12/lib/ruby/shared/rubygems/core_ext/kernel_require.rb:53:inrequire' from /opt/jruby-1.7.12/lib/ruby/gems/shared/gems/ffi-rzmq-core-1.0.3/lib/ffi-rzmq-core.rb:1:in (root)' from org/jruby/RubyKernel.java:1065:inrequire' from /opt/jruby-1.7.12/lib/ruby/gems/shared/gems/ffi-rzmq-core-1.0.3/lib/ffi-rzmq-core.rb:3:in (root)' from /opt/jruby-1.7.12/lib/ruby/shared/rubygems/core_ext/kernel_require.rb:1:in(root)' from org/jruby/RubyKernel.java:1065:in require' from /opt/jruby-1.7.12/lib/ruby/shared/rubygems/core_ext/kernel_require.rb:55:inrequire' from /opt/jruby-1.7.12/lib/ruby/gems/shared/gems/ffi-rzmq-2.0.1/lib/ffi-rzmq.rb:66:in (root)' from org/jruby/RubyKernel.java:1101:ineval' from /opt/jruby-1.7.12/lib/ruby/shared/rubygems/core_ext/kernel_require.rb:1:in (root)' from /opt/jruby-1.7.12/lib/ruby/shared/rubygems/core_ext/kernel_require.rb:135:inrequire' from (irb):1:in evaluate' from org/jruby/RubyKernel.java:1501:inloop' from org/jruby/RubyKernel.java:1264:in catch' from org/jruby/RubyKernel.java:1264:incatch' from /usr/bin/jirb:13:in `(root)'

— Reply to this email directly or view it on GitHub.

mistergibson commented 10 years ago

2.20

cmouse commented 10 years ago

I have this issue too, apparently ffi-rzmq does not check during compile time which API it should use. There is a difference between 2.x and 4.x about the naming of few functions that should be checked.

chuckremes commented 10 years ago

ffi-rzmq 1.x doesn’t really support libzmq 2.x anymore. Zeromq has moved very fast from 2.2 to 3.2 to 4.0 that the gem no longer tries to support everything.

If you cannot upgrade libzmq to 4.x, then I suggest using an older version of the gem to get 2.x support.

On Aug 8, 2014, at 3:00 PM, Aki Tuomi notifications@github.com wrote:

I have this issue too, apparently ffi-rzmq does not check during compile time which API it should use. There is a difference between 2.x and 4.x about the naming of few functions that should be checked.

— Reply to this email directly or view it on GitHub.

tpitale commented 10 years ago

@chuckremes Do you have any idea as to which older version of the gem is compatible and stable?

chuckremes commented 10 years ago

The last release to support 2.x was probably 1.0.3.

On Aug 11, 2014, at 7:15 PM, Tony Pitale notifications@github.com wrote:

@chuckremes Do you have any idea as to which older version of the gem is compatible and stable?

— Reply to this email directly or view it on GitHub.