Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

testcases编译错误 #73

Open
waterpeople opened this issue Nov 3, 2024 · 1 comment
Open

testcases编译错误 #73

waterpeople opened this issue Nov 3, 2024 · 1 comment

Comments

@waterpeople
Copy link

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()报错,应该如何解决。

@AIGC-yuxincai
Copy link

AIGC-yuxincai commented Nov 3, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants