在ubuntu lucid和maverick上编译scribe2.2与thrift 0.7.0时出错

error while compiling scribe2.2 with thrift 0.7.0 on ubuntu lucid and maverick

本文关键字:thrift 出错 0时 scribe2 lucid ubuntu maverick 编译      更新时间:2023-10-16

在ubuntu上编译scribe server时出现以下错误。

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*)’

我使用scriscribe 2.2与thrift 0.7.0安装thrift时没有错误。

我也在一篇文章中读到这个错误是在使用旧版本的thrift时遇到的。但是我用的是最新版本的thrift

似乎是节俭造成的问题。

解决方案:使用thrift稳定版本

逐字复制梁颖怡的话:

"我认为这个问题与最近节俭的变化有关(git的开发版本)。对于如下的thrift代码片段:enum X {…}X foo ();用于生成foo的原型的Thrift:X foo ();但是现在它会生成"X::type foo();",从而导致错误遇到。"

回答这里:http://groups.google.com/group/scribe-server/msg/b17bda3b80706558