我用C ++编写了一个库,我想在ruby上使用FFI扩展它。
我做了:
gem install ffi
和
gem install ffi --platform=ruby
这没用,所以我尝试将它添加到gemfile然后bundle install
这样做解决了我遇到的引用问题,但是当我尝试运行这个extconf.rb文件时:
require 'ffi'
module ECGInterpreterLib
extend FFI::Library
ffi_lib 'Lib/TesisECGLib.so' # load library from the same folder
attach_function :Diagnose, [:int], :uint
end
我收到此错误:
C:\RailsInstaller\Ruby2.2.0\bin\ruby.exe -e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift) C:/Users/Sam/RubymineProjects/EKGAPI/config/extconf.rb
(LoadError)
from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/ffi-1.9.14/lib/ffi/library.rb:100:in `map'
from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/ffi-1.9.14/lib/ffi/library.rb:100:in `ffi_lib'
from C:/Users/Sam/RubymineProjects/EKGAPI/config/extconf.rb:6:in `<module:ECGInterpreterLib>'
from C:/Users/Sam/RubymineProjects/EKGAPI/config/extconf.rb:4:in `<top (required)>'
from -e:1:in `load'
from -e:1:in `<main>'
我已阅读所有相关主题,但我似乎没有找到答案
关于如何解决这个问题的任何想法?