简体   繁体   English

Apache Thrift TNonblockingServer错误

[英]apache Thrift TNonblockingServer Error

I've been following Thrift C++ wiki tutorial . 我一直在关注Thrift C ++ Wiki教程 and everything works fine with TSimpleServer. 并且TSimpleServer一切正常。 But, when I try to implement TNonblockingServer I'm getting this error :( 但是,当我尝试实现TNonblockingServer时,出现此错误:(

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

I think its something related to the header files or the namespaces. 我认为它与头文件或名称空间有关。 The following headers im using: 我使用以下头文件:

#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;

any idea whats wrong? 你知道怎么了吗?

I understand that this is really late reply. 我了解这确实是晚答复。 It is due to missing libthriftnb library for TNonblockingServer. 这是因为缺少TNonblockingServer的libthriftnb库。

while Tsimplesever and TThreadedServer are in libthrift library so it was works with you. Tsimplesever和TThreadedServer在libthrift库中,因此可以使用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM