我正在尝试创建一个可以包装的 gem libpuzzle
,但无法解决这个flat_namespace
问题:
--- personal/sayzame ‹master* M⁇› » gem build sayzame.gemspec && gem install sayzame-0.0.1.gem
Successfully built RubyGem
Name: sayzame
Version: 0.0.1
File: sayzame-0.0.1.gem
Building native extensions. This could take a while...
Successfully installed sayzame-0.0.1
1 gem installed
--- personal/sayzame ‹master* M⁇› » pry -rsayzame -Ilib
[1] pry(main)> Sayzame.compare_images :a, :b
dyld: lazy symbol binding failed: Symbol not found: _puzzle_init_dvec
Referenced from: /usr/local/lib/libpuzzle.dylib
Expected in: flat namespace
dyld: Symbol not found: _puzzle_init_dvec
Referenced from: /usr/local/lib/libpuzzle.dylib
Expected in: flat namespace
[1] 56394 trace trap pry -rsayzame -Ilib
我的完整源代码在这里:https ://github.com/neezer/sayzame
我很确定问题出在我的ext/puzzle/extconf.rb
文件中,因为我没有正确链接库。我已经在ffi/ffi
's issue tracker上发布了关于它的信息,并跟进了这两条线索,但没有成功。
我真的很感激这里的任何帮助;很长一段时间以来,我一直把我的头撞在墙上。
可能相关: - https://groups.google.com/d/msg/picky-ruby/8kuG8FkATgU/89JLc6U7SrcJ