解决 coreseek 因 gcc 版本大于 4.7导致安装失败

在安装 coreseek 的过程中,抛出了以下错误

sphinxexpr.cpp:1013:43: error: ‘ExprEval’ was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive]
sphinxexpr.cpp:1013:43: note: declarations in dependent base ‘Expr_ArgVsSet_c<int>’ are not found by unqualified lookup
sphinxexpr.cpp:1013:43: note: use ‘this->ExprEval’ instead
make[2]: *** [sphinxexpr.o] Error 1
make[2]: Leaving directory `/core/coreseek-3.2.14/csft-3.2.14/src'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/core/coreseek-3.2.14/csft-3.2.14/src'
make: *** [all-recursive] Error 1

这个问题是因为 gcc 版本高于 4.7 造成的,具体可以点击这里查看 https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=667378

我们可以通过下载补丁,来解决这个问题

wget https://vifix.cn/blog/wp-content/uploads/2012/04/sphinxexpr.cpp_.patch_.zip

unzip sphinxexpr.cpp_.patch_.zip

patch -p1 < sphinxexpr.cpp-csft-3.2.13.patch

然后输入我 coreseek 源码的路径

/core/coreseek-3.2.14/csft-3.2.14/src/sphinxexpr.cpp

注意:我这里是 3.2.1 ,也有 4.1 的补丁,替换下路径就对了

然后我们重新编译


./configure --prefix=/usr/local/coreseek --without-python --without-unixodbc --with-mmseg --with-mmseg-includes=/usr/local/mmseg3/include/mmseg/ --with-mmseg-libs=/usr/local/mmseg3/lib/ --without-mysql

make && make install

结果如丝滑般润爽

阅读 3.8k

推荐阅读
袁超
用户专栏

37 人关注
57 篇文章
专栏主页