我一直在跟踪Thrift C++ wiki tutorial。而且使用TSimpleServer一切都很好。但是,当我尝试实现TNonblockingServer时,我得到了这个错误:(
undefined reference to `apache::thrift::server::TNonblockingServer::serve()
undefined reference to `apache::thrift::server::TNonblockingServer::~TNonblockingServer()我认为这与头文件或名称空间有关。im使用以下标头:
#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;你知道出什么问题了吗?
发布于 2014-06-06 20:12:32
我知道这是一个很晚的回复。这是由于缺少用于TNonblockingServer的libthriftnb库。
虽然Tsimplesever和TThreadedServer都在libthrift库中,但它也可以和你一起工作。
https://stackoverflow.com/questions/21915422
复制相似问题