Gooddbird / tinyrpc

c++ async rpc framework. 14w+qps.
Apache License 2.0
1.3k stars 191 forks source link

testcases编译错误 #73

Open waterpeople opened 3 weeks ago

waterpeople commented 3 weeks ago

luwei@haode:~/tinyrpc/testcases$ g++ test_tinypb_server.cc ../lib/libtinyrpc.a -o test_tinypb_server -lprotobuf -ltinyxml -lpthread -ldl /usr/bin/ld: /tmp/cckIA1Ib.o: in function QueryService::QueryService()': test_tinypb_server.cc:(.text._ZN12QueryServiceC2Ev[_ZN12QueryServiceC5Ev]+0x1f): undefined reference tovtable for QueryService' /usr/bin/ld: /tmp/cckIA1Ib.o: in function QueryServiceImpl::~QueryServiceImpl()': test_tinypb_server.cc:(.text._ZN16QueryServiceImplD2Ev[_ZN16QueryServiceImplD5Ev]+0x26): undefined reference toQueryService::~QueryService()' /usr/bin/ld: /tmp/cckIA1Ib.o:(.data.rel.ro._ZTV16QueryServiceImpl[_ZTV16QueryServiceImpl]+0x20): undefined reference to QueryService::GetDescriptor()' /usr/bin/ld: /tmp/cckIA1Ib.o:(.data.rel.ro._ZTV16QueryServiceImpl[_ZTV16QueryServiceImpl]+0x28): undefined reference toQueryService::CallMethod(google::protobuf::MethodDescriptor const, google::protobuf::RpcController, google::protobuf::Message const, google::protobuf::Message, google::protobuf::Closure)' /usr/bin/ld: /tmp/cckIA1Ib.o:(.data.rel.ro._ZTV16QueryServiceImpl[_ZTV16QueryServiceImpl]+0x30): undefined reference to `QueryService::GetRequestPrototype(google::protobuf::MethodDescriptor const) const' /usr/bin/ld: /tmp/cckIA1Ib.o:(.data.rel.ro._ZTV16QueryServiceImpl[_ZTV16QueryServiceImpl]+0x38): undefined reference to QueryService::GetResponsePrototype(google::protobuf::MethodDescriptor const*) const' /usr/bin/ld: /tmp/cckIA1Ib.o:(.data.rel.ro._ZTI16QueryServiceImpl[_ZTI16QueryServiceImpl]+0x10): undefined reference totypeinfo for QueryService' collect2: error: ld returned 1 exit status 我再使用了g++ test_tinypb_server.cc ../lib/libtinyrpc.a -o test_tinypb_server -lprotobuf -ltinyxml -lpthread -ldl编译之后QueryService()报错,应该如何解决。

AIGC-yuxincai commented 3 weeks ago

您好,已收到您的来信,谢谢!