这几天玩hhvm,把gcc环境都装到4.9了,然后编译coreseek的时候就出问题,google一大圈,貌似捕风捉影看到一些信息说是gcc4.7+的c++作用域必须用this->去引用,这里整理一个补丁仅供大家参考
coreseek 在gcc 4.7+ 上编译不通过 [sphinxexpr.o] Error 1 错误解决方案
错误如下:(每个人环境都不太一样,提示错误信息应该不尽相同但出错原因应该都是gcc4.7+以上版本作用域的问题)
sphinxexpr.cpp:1047:43: note: declarations in dependent base ‘Expr_ArgVsSet_c<int>’ are not found by unqualified lookup sphinxexpr.cpp:1047:43: note: use ‘this->ExprEval’ instead Makefile:390: recipe for target 'sphinxexpr.o' failed make[2]: *** [sphinxexpr.o] Error 1 make[2]: Leaving directory '/home/lxy/package/coreseek-3.2.14/csft-3.2.14/src' Makefile:258: recipe for target 'all' failed make[1]: *** [all] Error 2 make[1]: Leaving directory '/home/lxy/package/coreseek-3.2.14/csft-3.2.14/src' Makefile:330: recipe for target 'all-recursive' failed make: *** [all-recursive] Error 1
解决方案手动修改文件:
编辑sphinxexpr.cpp
将所有的:
T val = ExprEval ( this->m_pArg, tMatch );
替换成
T val = this->ExprEval ( this->m_pArg, tMatch );
保存然后重新编译就ok了!