Subject: [ruby-ffi] Strange error |
From: Peter |
Date: 3/18/10 3:25 PM |
To: ruby-ffi |
Hi,
I'm playing around with ffi and stumbled over a strange error:
module XosdRaw
extend FFI::Library
ffi_lib 'xosd'
enum :command, [:percentage,:string,:printf,:slider]
attach_function :xosd_display,
[:pointer,:int,:command,:varargs],:int
end
gets me this error:
ruby: symbol lookup error: /home/popel/.gem/ruby/1.8/gems/ffi-0.6.3/
lib/ffi_c.so: undefined symbol: rb_intern2
it seems that the lookup of type fails. I patched types.rb
def self.find_type(name, type_map = nil)
type_map = TypeDefs if type_map.nil?
code = type_map[name]
code = TypeDefs[name] unless code #<------added this line
code = name if !code && name.kind_of?(FFI::Type)
raise TypeError, "Unable to resolve type '#{name}'" unless code
return code
end
Now it works. I don't know if this is the right way (perhaps I did
something completly stupid) but perhaps some of you can have a look at
this.
THX
Peter
To unsubscribe from this group, send email to ruby-ffi+unsubscribegooglegroups.com or reply to this email with the words "REMOVE ME" as the subject.