sphinx编译安装出错:undefined reference to libiconv 问题解决

编译过程中提示出错:
错误描述

/usr/local/sphinx/src/sphinx.cpp:20060:undefined reference to libiconv_open'
/usr/local/sphinx/src/sphinx.cpp:20078: undefined reference to 
libiconv’
/usr/local/sphinx/src/sphinx.cpp:20084: undefined reference to libiconv_close'
collect2: ld returned 1exit status
make[2]:***[indexer]Error1
make[2]:Leaving directory 
/home/sphinx/src’
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

即可。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章