1

我正在为我的 Ruby Gem 编写一个 C 扩展。但是#find_header 的行为太奇怪了。

# extconf.rb

require 'mkmf'

find_header 'pocketsphinx.h', '/usr/local/include/pocketsphinx'
find_header 'cmd_ln.h', '/usr/local/include/sphinxbase'
find_library 'pocketsphinx', 'ps_args'
find_library 'sphinxbase', 'cmd_ln_init'

create_makefile 'pocket_sphinx/pocket_sphinx'

这是我通过运行$ rake compilerake-compiler 提供的结果:

$ rake compile
cd tmp/x86_64-darwin13.0/pocket_sphinx/2.1.2
/Users/siegfried/.rvm/rubies/ruby-2.1.2/bin/ruby -I. ../../../../ext/pocket_sphinx/extconf.rb
checking for pocketsphinx.h in /usr/local/include/pocketsphinx... no
checking for cmd_ln.h in /usr/local/include/sphinxbase... yes
checking for ps_args() in -lpocketsphinx... yes
checking for cmd_ln_init() in -lsphinxbase... yes
creating Makefile

它表明缺少标题,但实际上没有。

$ ls /usr/local/include/pocketsphinx
cmdln_macro.h       fsg_set.h       pocketsphinx.h      pocketsphinx.pxd    pocketsphinx_export.h   ps_lattice.h        ps_mllr.h

怎么了?

4

0 回答 0