tinyrpc icon indicating copy to clipboard operation
tinyrpc copied to clipboard

testcases编译错误

Open waterpeople opened this issue 1 year ago • 1 comments

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 to vtable for QueryService' /usr/bin/ld: /tmp/cckIA1Ib.o: in function QueryServiceImpl::~QueryServiceImpl()': test_tinypb_server.cc:(.text._ZN16QueryServiceImplD2Ev[_ZN16QueryServiceImplD5Ev]+0x26): undefined reference to QueryService::~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 to QueryService::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 to `typeinfo 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()报错,应该如何解决。

waterpeople avatar Nov 03 '24 18:11 waterpeople

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

AIGC-yuxincai avatar Nov 03 '24 18:11 AIGC-yuxincai