sogou / srpc

RPC framework based on C++ Workflow. Supports SRPC, Baidu bRPC, Tencent tRPC, thrift protocols.
Apache License 2.0
1.95k stars 385 forks source link

srpc 在编译tutorial的报错 #259

Closed Cai-Yao closed 2 years ago

Cai-Yao commented 2 years ago

CMakeFiles/srpc_pb_server.dir/tutorial-01-srpc_pb_server.cc.o: In function ExampleServiceImpl::Echo(EchoRequest*, EchoResponse*, srpc::RPCContext*)': /root/lib/src/srpc/tutorial/build.cmake/echo_pb.pb.h:633: undefined reference togoogle::protobuf::internal::ArenaStringPtr::Set(google::protobuf::internal::ArenaStringPtr::EmptyDefault, std::cxx11::basic_string<char, std::char_traits, std::allocator >&&, google::protobuf::Arena)' CMakeFiles/srpc_pb_server.dir/echo_pb.pb.cc.o: In function EchoRequest::~EchoRequest()': /usr/local/include/google/protobuf/arenastring.h:357: undefined reference togoogle::protobuf::internal::fixed_address_empty_string' CMakeFiles/srpc_pb_server.dir/echo_pb.pb.cc.o: In function EchoResponse::~EchoResponse()': /usr/local/include/google/protobuf/arenastring.h:358: undefined reference togoogle::protobuf::internal::fixed_address_empty_string' CMakeFiles/srpc_pb_server.dir/echo_pb.pb.cc.o: In function `EchoRequest::EchoRequest(google::protobuf::Arena)': /usr/local/include/google/protobuf/arenastring.h:98: undefined reference to google::protobuf::internal::fixed_address_empty_string' CMakeFiles/srpc_pb_server.dir/echo_pb.pb.cc.o: In functionEchoRequest::EchoRequest(google::protobuf::Arena)': /usr/local/include/google/protobuf/generated_message_util.h:250: undefined reference to `google::protobuf::internal::InitSCCImpl(google::protobuf::internal::SCCInfoBase)' CMakeFiles/srpc_pb_server.dir/echo_pb.pb.cc.o: In function EchoRequest::default_instance()': /usr/local/include/google/protobuf/generated_message_util.h:250: undefined reference togoogle::protobuf::internal::InitSCCImpl(google::protobuf::internal::SCCInfoBase)' CMakeFiles/srpc_pb_server.dir/echo_pb.pb.cc.o: In function `EchoResponse::EchoResponse(google::protobuf::Arena)': /usr/local/include/google/protobuf/arenastring.h:98: undefined reference to google::protobuf::internal::fixed_address_empty_string' CMakeFiles/srpc_pb_server.dir/echo_pb.pb.cc.o: In functionEchoResponse::EchoResponse(google::protobuf::Arena)': /usr/local/include/google/protobuf/generated_message_util.h:250: undefined reference to `google::protobuf::internal::InitSCCImpl(google::protobuf::internal::SCCInfoBase)' CMakeFiles/srpc_pb_server.dir/echo_pb.pb.cc.o: In function EchoResponse::default_instance()': /usr/local/include/google/protobuf/generated_message_util.h:250: undefined reference togoogle::protobuf::internal::InitSCCImpl(google::protobuf::internal::SCCInfoBase)' CMakeFiles/srpc_pb_server.dir/echo_pb.pb.cc.o: In function `EchoRequest google::protobuf::Arena::CreateMaybeMessage(google::protobuf::Arena)': /usr/local/include/google/protobuf/arena.h:658: undefined reference to google::protobuf::Arena::AllocateAlignedNoHook(unsigned long)' CMakeFiles/srpc_pb_server.dir/echo_pb.pb.cc.o: In functionEchoResponse google::protobuf::Arena::CreateMaybeMessage(google::protobuf::Arena)': /usr/local/include/google/protobuf/arena.h:658: undefined reference to google::protobuf::Arena::AllocateAlignedNoHook(unsigned long)' CMakeFiles/srpc_pb_server.dir/echo_pb.pb.cc.o: In functionEchoRequest::_InternalParse(char const, google::protobuf::internal::ParseContext)': /root/lib/src/srpc/tutorial/build.cmake/echo_pb.pb.h:568: undefined reference to `google::protobuf::internal::ArenaStringPtr::Mutable[abi:cxx11](google::protobuf::internal::ArenaStringPtr::EmptyDefault, google::protobuf::Arena)' CMakeFiles/srpc_pb_server.dir/echo_pb.pb.cc.o: In function EchoResponse::_InternalParse(char const*, google::protobuf::internal::ParseContext*)': /root/lib/src/srpc/tutorial/build.cmake/echo_pb.pb.h:645: undefined reference togoogle::protobuf::internal::ArenaStringPtr::Mutable[abi:cxx11](google::protobuf::internal::ArenaStringPtr::EmptyDefault, google::protobuf::Arena*)' CMakeFiles/srpc_pb_server.dir/echo_pb.pb.cc.o: In function EchoRequest::MergeFrom(EchoRequest const&)': /root/lib/src/srpc/tutorial/build.cmake/echo_pb.pb.h:472: undefined reference togoogle::protobuf::internal::ArenaStringPtr::Set(google::protobuf::internal::ArenaStringPtr::EmptyDefault, std::cxx11::basic_string<char, std::char_traits, std::allocator > const&, google::protobuf::Arena)' CMakeFiles/srpc_pb_server.dir/echo_pb.pb.cc.o: In function EchoResponse::EchoResponse(EchoResponse const&)': /usr/local/include/google/protobuf/arenastring.h:98: undefined reference togoogle::protobuf::internal::fixed_address_empty_string' CMakeFiles/srpc_pb_server.dir/echo_pb.pb.cc.o: In function EchoResponse::EchoResponse(EchoResponse const&)': /root/lib/src/srpc/tutorial/build.cmake/echo_pb.pb.cc:437: undefined reference togoogle::protobuf::internal::ArenaStringPtr::Set(google::protobuf::internal::ArenaStringPtr::EmptyDefault, std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, google::protobuf::Arena)' CMakeFiles/srpc_pb_server.dir/echo_pb.pb.cc.o: In function EchoResponse::MergeFrom(EchoResponse const&)': /root/lib/src/srpc/tutorial/build.cmake/echo_pb.pb.h:622: undefined reference togoogle::protobuf::internal::ArenaStringPtr::Set(google::protobuf::internal::ArenaStringPtr::EmptyDefault, std::cxx11::basic_string<char, std::char_traits, std::allocator > const&, google::protobuf::Arena*)' CMakeFiles/srpc_pb_server.dir/echo_pb.pb.cc.o: In function EchoRequest::EchoRequest(EchoRequest const&)': /usr/local/include/google/protobuf/arenastring.h:98: undefined reference togoogle::protobuf::internal::fixed_address_empty_string' CMakeFiles/srpc_pb_server.dir/echo_pb.pb.cc.o: In function EchoRequest::EchoRequest(EchoRequest const&)': /root/lib/src/srpc/tutorial/build.cmake/echo_pb.pb.cc:139: undefined reference togoogle::protobuf::internal::ArenaStringPtr::Set(google::protobuf::internal::ArenaStringPtr::EmptyDefault, std::cxx11::basic_string<char, std::char_traits, std::allocator > const&, google::protobuf::Arena)' CMakeFiles/srpc_pb_server.dir/echo_pb.pb.cc.o: In function EchoRequest::MergeFrom(EchoRequest const&)': /root/lib/src/srpc/tutorial/build.cmake/echo_pb.pb.h:545: undefined reference togoogle::protobuf::internal::ArenaStringPtr::Set(google::protobuf::internal::ArenaStringPtr::EmptyDefault, std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, google::protobuf::Arena)' CMakeFiles/srpc_pb_server.dir/echo_pb.pb.cc.o: In function EchoRequest::EchoRequest(EchoRequest const&)': /root/lib/src/srpc/tutorial/build.cmake/echo_pb.pb.cc:144: undefined reference togoogle::protobuf::internal::ArenaStringPtr::Set(google::protobuf::internal::ArenaStringPtr::EmptyDefault, std::cxx11::basic_string<char, std::char_traits, std::allocator > const&, google::protobuf::Arena)' CMakeFiles/srpc_pb_server.dir/echo_pb.pb.cc.o: In function `google::protobuf::UnknownFieldSet google::protobuf::internal::InternalMetadata::mutable_unknown_fields_slow()': /usr/local/include/google/protobuf/arena.h:496: undefined reference to google::protobuf::internal::ArenaImpl::AllocateAlignedAndAddCleanup(unsigned long, void (*)(void*))' CMakeFiles/srpc_pb_server.dir/echo_pb.pb.cc.o: In function__static_initialization_and_destruction_0': /root/lib/src/srpc/tutorial/build.cmake/echo_pb.pb.cc:109: undefined reference to google::protobuf::internal::AddDescriptors(google::protobuf::internal::DescriptorTable const*)' /root/lib/src/srpc/_lib/libsrpc.so: undefined reference togoogle::protobuf::internal::VerifyUTF8(google::protobuf::StringPiece, char const*)' /root/lib/src/srpc/_lib/libsrpc.so: undefined reference to `google::protobuf::internal::ArenaStringPtr::Set(std::cxx11::basic_string<char, std::char_traits, std::allocator > const, std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, google::protobuf::Arena)' /root/lib/src/srpc/_lib/libsrpc.so: undefined reference to google::protobuf::internal::ArenaStringPtr::Destroy(google::protobuf::internal::ArenaStringPtr::EmptyDefault, google::protobuf::Arena*)' /root/lib/src/srpc/_lib/libsrpc.so: undefined reference togoogle::protobuf::MessageLite::ParseFromString(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&)' /root/lib/src/srpc/_lib/libsrpc.so: undefined reference to google::protobuf::internal::ArenaImpl::AddCleanup(void*, void (*)(void*))' /root/lib/src/srpc/_lib/libsrpc.so: undefined reference togoogle::protobuf::StringPiece::LogFatalSizeTooBig(unsigned long, char const*)' collect2: error: ld returned 1 exit status make[3]: [../srpc_pb_server] Error 1 make[3]: Leaving directory `/root/lib/src/srpc/tutorial/build.cmake' make[2]: [CMakeFiles/srpc_pb_server.dir/all] Error 2 make[2]: Leaving directory /root/lib/src/srpc/tutorial/build.cmake' make[1]: *** [all] Error 2 make[1]: Leaving directory/root/lib/src/srpc/tutorial/build.cmake' make: *** [all] Error 2


protoc --version libprotoc 21.5

Barenboim commented 2 years ago

没有安装libprotobuf? SPRC clone的时候,是没有自动下载protobuf的。

Cai-Yao commented 2 years ago

安装了,不过好像是多个版本的原因,我删掉重装后,就可以正常编译了