c++ - apache Thrift TNonblockingServer 错误

标签 c++ thrift

我一直在关注 Thrift C++ wiki tutorial .使用 TSimpleServer 一切正常。 但是,当我尝试实现 TNonblockingServer 时,我遇到了这个错误:(

undefined reference to `apache::thrift::server::TNonblockingServer::serve()
undefined reference to `apache::thrift::server::TNonblockingServer::~TNonblockingServer()

我认为它与头文件或命名空间有关。 我正在使用以下 header :

#include <thrift/protocol/TBinaryProtocol.h>
#include <thrift/server/TSimpleServer.h>
#include <thrift/transport/TServerSocket.h>
#include <thrift/transport/TBufferTransports.h>
#include <thrift/concurrency/ThreadManager.h>
#include <thrift/concurrency/PosixThreadFactory.h>
#include <thrift/server/TThreadedServer.h>
#include <thrift/server/TNonblockingServer.h>

using namespace ::apache::thrift;
using namespace ::apache::thrift::protocol;
using namespace ::apache::thrift::transport;
using namespace ::apache::thrift::server;
using namespace ::apache::thrift::concurrency;

知道哪里出了问题吗?

最佳答案

我知道这真的是迟到的回复。 这是由于缺少 TNonblockingServer 的 libthriftnb 库。

虽然 Tsimplesever 和 TThreadedServer 在 libthrift 库中,所以它可以与您一起使用。

关于c++ - apache Thrift TNonblockingServer 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21915422/

相关文章:

java - Thrift Java 服务器 - 如何配置线程

c++ - 引用成员变量作为类成员

hadoop - 什么 cassandra 客户端用于 haoop 集成?

c++ - 如何将数组从c++传递到python函数并将python返回的数组检索到c++

c++ - 通过套接字发送结构

java - 使用 Hiveserver2 Thrift Java 客户端时请求挂起

api - Thrift 作为 REST 的公共(public) API 替代品?

ssl - 与二进制模式的 Spark Thrift 服务器的通信是否安全传输?

c++ - 为什么结构的 sizeof 不等于每个成员的 sizeof 之和?

c++ - 虚函数问题