【转】Coreseek在GCC 4.7上编译不通过的问题

 

       问题解决记录,原文地址:http://vifix.cn/blog/coreseek-cant-make-in-gcc-4-7-enviroment.html

    

 

      今天在archlinux在安装coreseek 4.1-beta时碰到的问题,在g++编译sphinxexpr.cpp时:

 

g++ -DHAVE_CONFIG_H -I. -I../config  -DSYSCONFDIR="\"/opt/coreseek-3.2.14/etc\"" -DDATADIR="\"/opt/coreseek-3.2.14/var/data\"" -I/usr/local/include -pthread -I/usr/include/mysql -fPIC -pipe -fstack-protector --param=ssp-buffer-size=4 -D_FORTIFY_SOURCE=2 -fno-strict-aliasing -DBIG_JOINS=1 -fomit-frame-pointer  -g  -I/opt/mmseg-3.2.14/include/mmseg/   -Wall -g -D_FILE_OFFSET_BITS=64 -O3 -DNDEBUG -MT sphinxexpr.o -MD -MP -MF .deps/sphinxexpr.Tpo -c -o sphinxexpr.o sphinxexpr.cpp
sphinxexpr.cpp: In constructor ‘ExprParser_t::ExprParser_t(CSphSchema*, ISphExprHook*)’:
sphinxexpr.cpp:742:17: warning: ‘ExprParser_t::m_pExtra’ will be initialized after [-Wreorder]
sphinxexpr.cpp:711:19: warning:   ‘ISphExprHook* ExprParser_t::m_pHook’ [-Wreorder]
sphinxexpr.cpp:698:2: warning:   when initialized here [-Wreorder]
sphinxexpr.cpp: In instantiation of ‘int Expr_In_c<T>::IntEval(const CSphMatch&) const [with T = float]’:
sphinxexpr.cpp:3152:1:   required from here
sphinxexpr.cpp:1823: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:1823:43: note: declarations in dependent base ‘Expr_ArgVsSet_c<float>’ are not found by unqualified lookup
sphinxexpr.cpp:1823:43: note: use ‘this->ExprEval’ instead
sphinxexpr.cpp: In instantiation of ‘int Expr_In_c<T>::IntEval(const CSphMatch&) const [with T = long long int]’:
sphinxexpr.cpp:3152:1:   required from here
sphinxexpr.cpp:1823: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:1823:43: note: declarations in dependent base ‘Expr_ArgVsSet_c<long long int>’ are not found by unqualified lookup
sphinxexpr.cpp:1823:43: note: use ‘this->ExprEval’ instead
sphinxexpr.cpp: In instantiation of ‘int Expr_In_c<T>::IntEval(const CSphMatch&) const [with T = int]’:
sphinxexpr.cpp:3152:1:   required from here
sphinxexpr.cpp:1823: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:1823:43: note: declarations in dependent base ‘Expr_ArgVsSet_c<int>’ are not found by unqualified lookup
sphinxexpr.cpp:1823:43: note: use ‘this->ExprEval’ instead
sphinxexpr.cpp: In instantiation of ‘int Expr_Interval_c<T>::IntEval(const CSphMatch&) const [with T = float]’:
sphinxexpr.cpp:3152:1:   required from here
sphinxexpr.cpp:1777: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:1777:43: note: declarations in dependent base ‘Expr_ArgVsSet_c<float>’ are not found by unqualified lookup
sphinxexpr.cpp:1777:43: note: use ‘this->ExprEval’ instead
sphinxexpr.cpp: In instantiation of ‘int Expr_Interval_c<T>::IntEval(const CSphMatch&) const [with T = long long int]’:
sphinxexpr.cpp:3152:1:   required from here
sphinxexpr.cpp:1777: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:1777:43: note: declarations in dependent base ‘Expr_ArgVsSet_c<long long int>’ are not found by unqualified lookup
sphinxexpr.cpp:1777:43: note: use ‘this->ExprEval’ instead
sphinxexpr.cpp: In instantiation of ‘int Expr_Interval_c<T>::IntEval(const CSphMatch&) const [with T = int]’:
sphinxexpr.cpp:3152:1:   required from here
sphinxexpr.cpp:1777: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:1777:43: note: declarations in dependent base ‘Expr_ArgVsSet_c<int>’ are not found by unqualified lookup
sphinxexpr.cpp:1777:43: note: use ‘this->ExprEval’ instead
sphinxexpr.cpp: In instantiation of ‘int Expr_IntervalConst_c<T>::IntEval(const CSphMatch&) const [with T = float]’:
sphinxexpr.cpp:3152:1:   required from here
sphinxexpr.cpp:1746: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:1746:43: note: declarations in dependent base ‘Expr_ArgVsSet_c<float>’ are not found by unqualified lookup
sphinxexpr.cpp:1746:43: note: use ‘this->ExprEval’ instead
sphinxexpr.cpp: In instantiation of ‘int Expr_IntervalConst_c<T>::IntEval(const CSphMatch&) const [with T = long long int]’:
sphinxexpr.cpp:3152:1:   required from here
sphinxexpr.cpp:1746: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:1746:43: note: declarations in dependent base ‘Expr_ArgVsSet_c<long long int>’ are not found by unqualified lookup
sphinxexpr.cpp:1746:43: note: use ‘this->ExprEval’ instead
sphinxexpr.cpp: In instantiation of ‘int Expr_IntervalConst_c<T>::IntEval(const CSphMatch&) const [with T = int]’:
sphinxexpr.cpp:3152:1:   required from here
sphinxexpr.cpp:1746: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:1746:43: note: declarations in dependent base ‘Expr_ArgVsSet_c<int>’ are not found by unqualified lookup
sphinxexpr.cpp:1746:43: note: use ‘this->ExprEval’ instead
make[2]: *** [sphinxexpr.o] Error 1
make[2]: Leaving directory `/home/mac/Downloads/coreseek-4.1-beta/csft-4.1/src'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/home/mac/Downloads/coreseek-4.1-beta/csft-4.1/src'
make: *** [all-recursive] Error 1

 

 

      在替换为coreseek 3.2.13后仍然发生了类似问题,但是在自己的Mac OS X 10.6.8上类似的编译却没有碰到这个问题,于是觉得很奇怪。

 

      搜索之后,仅找到一个有用的链接:http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=667378,是关于coreseek上游的sphinx的同样问题的,看了一下了解似乎是gcc 4.7的C++作用域的问题(?),上面的debian bugs里面提供了一个patch,看了下patch的内容,也对自己本地的coreseek的制作了同样的补丁,压缩包发布如下,使用时注意版本。见附件~

 

你可能感兴趣的:(coreseek)