在 ubuntu lucid 和 maverick 上使用 thrift 0.7.0 编译 scribe2.2 时出错
我在 ubuntu 上编译 scribe 服务器时遇到以下错误。
In file included from store.cpp:27:
scribe_server.h:45: error: conflicting return type specified for ‘virtual scribe::thrift::ResultCode scribeHandler::Log(const std::vector<scribe::thrift::LogEntry, std::allocator<scribe::thrift::LogEntry> >&)’
../src/gen-cpp/scribe.h:18: error: overriding ‘virtual scribe::thrift::ResultCode::type scribe::thrift::scribeIf::Log(const std::vector<scribe::thrift::LogEntry, std::allocator<scribe::thrift::LogEntry> >&)’
store.cpp: In member function ‘virtual bool ThriftFileStore::openInternal(bool, tm*)’
我正在使用 scribe 2.2 和 thrift 0.7.0 安装thrift时没有出现错误。
我还在一篇文章中读到,使用旧版本的 thrift 时会遇到此错误。但我正在使用最新版本的thrift。
I am getting following error while compiling scribe server on ubuntu.
In file included from store.cpp:27:
scribe_server.h:45: error: conflicting return type specified for ‘virtual scribe::thrift::ResultCode scribeHandler::Log(const std::vector<scribe::thrift::LogEntry, std::allocator<scribe::thrift::LogEntry> >&)’
../src/gen-cpp/scribe.h:18: error: overriding ‘virtual scribe::thrift::ResultCode::type scribe::thrift::scribeIf::Log(const std::vector<scribe::thrift::LogEntry, std::allocator<scribe::thrift::LogEntry> >&)’
store.cpp: In member function ‘virtual bool ThriftFileStore::openInternal(bool, tm*)’
I am using scribe 2.2 with thrift 0.7.0
There were no errors while installing thrift.
Also I read in one post that this error is encountered while using older versions of thrift. But I am using latest version of thrift.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
看来是节俭出了问题。
解决方案:使用 thrift 稳定版本
照搬梁英毅的话:
“我认为这个问题与 thrift 最近的变化有关
(git 开发版本)。对于像这样的节俭代码片段:
枚举 X {
...
}
X foo();
thrift 用于为 foo 生成此原型:
X foo();
但现在它生成“X::type foo();”,导致错误
遇到。”
在这里回答:http://groups.google.com/group/scribe -服务器/msg/b17bda3b80706558
Seems to be a problem from thrift.
Solution: use thrift stable version
Copying literally Ying-Yi Liang words:
"I think this issue has something to do with a recent change in thrift
(the git dev version). For a thrift snippet like:
enum X {
...
}
X foo();
thrift used to generate this prototype for foo:
X foo();
but now it generates "X::type foo();", resulting in the error you
encountered."
answered here: http://groups.google.com/group/scribe-server/msg/b17bda3b80706558