編譯過程中提示出錯:
錯誤描述
/usr/local/sphinx/src/sphinx.cpp:20060:undefined reference to libiconv_open'
libiconv’
/usr/local/sphinx/src/sphinx.cpp:20078: undefined reference to
/usr/local/sphinx/src/sphinx.cpp:20084: undefined reference to libiconv_close'
/home/sphinx/src’
collect2: ld returned 1exit status
make[2]:***[indexer]Error1
make[2]:Leaving directory
make[1]: *** [all] Error 2
make[1]: Leaving directory `/home/sphinx/src’
make: *** [all-recursive] Error 1
===============以下爲解決方案=======================================================
原因是g++沒有添加 -libiconv選項
cd sphinx-2.2.10-release
vi src/Makefile
把LIBS = -lm -lz -lexpat -L/usr/local/lib -lrt -lpthread
改成
LIBS = -lm -lz -lexpat -L/usr/local/lib -lrt -lpthread -liconv
即可。