安裝sphinx時不停報錯。。。鬱悶
在make時報錯,錯誤內容:
r/local/src/sphinx/sphinx-0.9.8-rc2/src/tokenizer_zhcn.cpp:280: undefined reference to `libiconv'
libsphinx.a(tokenizer_zhcn.o)(.text+0x6fd):/usr/local/src/sphinx/sphinx-0.9.8-rc2/src/tokenizer_zhcn.cpp:55: undefined reference to
`libiconv_open'
libsphinx.a(tokenizer_zhcn.o)(.text+0x719):/usr/local/src/sphinx/sphinx-0.9.8-rc2/src/tokenizer_zhcn.cpp:58: undefined reference to
`libiconv'
libsphinx.a(tokenizer_zhcn.o)(.text+0x7a4): In function `CSphTokenizer_zh_CN_UTF8::~CSphTokenizer_zh_CN_UTF8()':
/usr/local/src/sphinx/sphinx-0.9.8-rc2/src/tokenizer_zhcn.cpp:34: undefined reference to `libiconv_close'
libsphinx.a(tokenizer_zhcn.o)(.text+0xd04): In function `CSphTokenizer_zh_CN_UTF8::~CSphTokenizer_zh_CN_UTF8()':
/usr/local/src/sphinx/sphinx-0.9.8-rc2/src/tokenizer_zhcn.cpp:34: undefined reference to `libiconv_close'
libsphinx.a(tokenizer_zhcn.o)(.text+0x125c): In function `CSphTokenizer_zh_CN_UTF8::~CSphTokenizer_zh_CN_UTF8()':
/usr/local/src/sphinx/sphinx-0.9.8-rc2/src/tokenizer_zhcn.cpp:34: undefined reference to `libiconv_close'
解決
一開始以為libiconv的問題,所以安裝了libiconv,又重灌了幾次還是報錯。
最後終於在官網的論壇上找著辦法了。
編輯:
./src/MakeFile檔案
將
LIBS = -lm -lexpat -L/usr/local/lib
改成
LIBS = -lm -lexpat -liconv -L/usr/local/lib
然後再次make
make install
這次沒問題了。
libiconv 這個庫真是。。。唉,安裝php的時候也是經常因為它出錯。最後告訴大家在修改了上面的配置後,對sphinx的使用沒有任何影響。