Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Cannot Reproduce
-
0.9.3
-
None
-
Virtual studio 2013 and windows 7
Description
$. add TestServer.thrift
namespace cpp zam.thrift.test namespace py thriftTest namespace java com.zam.thrift.test namespace php thriftTest service Hello { string helloString(1:string word) }
$. compile TestServer.thrift
thrift --strict --gen cpp --out . TestServer.thrift
$. copy build c++ code in Visual Studio and run, tips unresolved external symbol :
"public: virtual void __cdecl apache::thrift::server::TServerFramework::serve(void)" (?serve@TServerFramework@server@thrift@apache@@UEAAXXZ) "public: virtual void __cdecl apache::thrift::server::TServerFramework::serve(void)" (?serve@TServerFramework@server@thrift@apache@@UEAAXXZ) "public: __cdecl apache::thrift::server::TServerFramework::TServerFramework(class boost::shared_ptr<class apache::thrift::TProcessorFactory> const &,class boost::shared_ptr<class apache::thrift::transport::TServerTransport> const &,class boost::shared_ptr<class apache::thrift::transport::TTransportFactory> const &,class boost::shared_ptr<class apache::thrift::protocol::TProtocolFactory> const &)" (??0TServerFramework@server@thrift@apache@@QEAA@AEBV?$shared_ptr@VTProcessorFactory@thrift@apache@@@boost@@AEBV?$shared_ptr@VTServerTransport@transport@thrift@apache@@@5@AEBV?$shared_ptr@VTTransportFactory@transport@thrift@apache@@@5@AEBV?$shared_ptr@VTProtocolFactory@protocol@thrift@apache@@@5@@Z),该符号在函数 "public: __cdecl apache::thrift::server::TSimpleServer::TSimpleServer(class boost::shared_ptr<class apache::thrift::TProcessorFactory> const &,class boost::shared_ptr<class apache::thrift::transport::TServerTransport> const &,class boost::shared_ptr<class apache::thrift::transport::TTransportFactory> const &,class boost::shared_ptr<class apache::thrift::protocol::TProtocolFactory> const &)" (??0TSimpleServer@server@thrift@apache@@QEAA@AEBV?$shared_ptr@VTProcessorFactory@thrift@apache@@@boost@@AEBV?$shared_ptr@VTServerTransport@transport@thrift@apache@@@5@AEBV?$shared_ptr@VTTransportFactory@transport@thrift@apache@@@5@AEBV?$shared_ptr@VTProtocolFactory@protocol@thrift@apache@@@5@@Z)
$.why error is occur of TServerFramework file?
$.main code:
#include "hello.h" #include <Thrift.h> #include <thrift/Thrift.h> #include <thrift/protocol/TBinaryProtocol.h> #include <thrift/server/TSimpleServer.h> #include <thrift/transport/TServerSocket.h> #include <thrift/transport/TBufferTransports.h> #pragma comment(lib, "libthrift.lib") #pragma comment(lib, "libeay32.lib") #pragma comment(lib, "ssleay32.lib") using namespace ::apache::thrift; using namespace ::apache::thrift::protocol; using namespace ::apache::thrift::transport; using namespace ::apache::thrift::server; using boost::shared_ptr; class helloHandler : virtual public helloIf { public: helloHandler() { // Your initialization goes here } void func1() { // Your implementation goes here printf("Hello Thrift\n"); } }; int main(int argc, char **argv) { WORD wVersionRequested; WSADATA wsaData; int err; wVersionRequested = MAKEWORD(2, 2); err = WSAStartup(wVersionRequested, &wsaData); int port = 9090; shared_ptr<helloHandler> handler(new helloHandler()); shared_ptr<TProcessor> processor(new helloProcessor(handler)); shared_ptr<TServerTransport> serverTransport(new TServerSocket(port)); shared_ptr<TTransportFactory> transportFactory(new TBufferedTransportFactory()); shared_ptr<TProtocolFactory> protocolFactory(new TBinaryProtocolFactory()); TSimpleServer server(processor, serverTransport, transportFactory, protocolFactory); server.serve(); return 0; }
Attachments
Issue Links
- relates to
-
THRIFT-3965 VisualStudio project cannot build compiler CPP project
- Closed
-
THRIFT-3973 Remove MSVC C++ projects to improve maintainability; document building Thrift on Windows using CMake to generate project files
- Open
- links to