你好,我也是libprotoc 3.12.4,且moduo正确安装,cmake3.22.1,但是只编译到82%,还是会出现大量protoc的错误啊:
[ 82%] Linking CXX executable ../../../../bin/provider
/usr/bin/ld: CMakeFiles/provider.dir/friendService.cpp.o: in function void* google::protobuf::Arena::AllocateInternal<std::cxx11::basic_string<char, std::char_traits, std::allocator > >(bool)': /usr/local/include/google/protobuf/arena.h:536: undefined reference to google::protobuf::Arena::AllocateAlignedNoHook(unsigned long)'
/usr/bin/ld: CMakeFiles/provider.dir/friendService.cpp.o: in function fixbug::GetFriendsListResponse::_internal_add_friendsabi:cxx11': /home/dai/Study_Linux/c++cpp/rpc分布式/KVstorageBaseRaft-cpp-main/example/rpcExample/friend.pb.h:873: undefined reference to google::protobuf::RepeatedPtrField<std::cxx11::basic_string<char, std::char_traits, std::allocator > >::Add()'
/usr/bin/ld: CMakeFiles/provider.dir//friend.pb.cc.o: in function fixbug::ResultCode::_InternalParse(char const*, google::protobuf::internal::ParseContext*)': /home/dai/Study_Linux/c++cpp/rpc分布式/KVstorageBaseRaft-cpp-main/example/rpcExample/friend.pb.cc:230: undefined reference to google::protobuf::internal::InlineGreedyStringParser(std::cxx11::basic_string<char, std::char_traits, std::allocator >, char const, google::protobuf::internal::ParseContext*)'
/usr/bin/ld: /home/dai/Study_Linux/c++cpp/rpc分布式/KVstorageBaseRaft-cpp-main/example/rpcExample/friend.pb.cc:240: undefined reference to google::protobuf::internal::UnknownFieldParse(unsigned long, google::protobuf::UnknownFieldSet*, char const*, google::protobuf::internal::ParseContext*)' /usr/bin/ld: CMakeFiles/provider.dir//friend.pb.cc.o: in function fixbug::ResultCode::_InternalSerialize(unsigned char*, google::protobuf::io::EpsCopyOutputStream*) const':
/home/dai/Study_Linux/c++cpp/rpc分布式/KVstorageBaseRaft-cpp-main/example/rpcExample/friend.pb.cc:275: undefined reference to google::protobuf::internal::WireFormat::InternalSerializeUnknownFieldsToArray(google::protobuf::UnknownFieldSet const&, unsigned char*, google::protobuf::io::EpsCopyOutputStream*)' /usr/bin/ld: CMakeFiles/provider.dir//friend.pb.cc.o: in function fixbug::ResultCode::ByteSizeLong() const':
/home/dai/Study_Linux/c++cpp/rpc分布式/KVstorageBaseRaft-cpp-main/example/rpcExample/friend.pb.cc:305: undefined reference to google::protobuf::internal::ComputeUnknownFieldsSize(google::protobuf::internal::InternalMetadata const&, unsigned long, google::protobuf::internal::CachedSize*)' /usr/bin/ld: CMakeFiles/provider.dir//friend.pb.cc.o: in function fixbug::GetFriendsListRequest::_InternalParse(char const*, google::protobuf::internal::ParseContext*)':
/home/dai/Study_Linux/c++cpp/rpc分布式/KVstorageBaseRaft-cpp-main/example/rpcExample/friend.pb.cc:454: undefined reference to google::protobuf::internal::UnknownFieldParse(unsigned long, google::protobuf::UnknownFieldSet*, char const*, google::protobuf::internal::ParseContext*)' /usr/bin/ld: CMakeFiles/provider.dir//friend.pb.cc.o: in function fixbug::GetFriendsListRequest::_InternalSerialize(unsigned char*, google::protobuf::io::EpsCopyOutputStream*) const':
/home/dai/Study_Linux/c++cpp/rpc分布式/KVstorageBaseRaft-cpp-main/example/rpcExample/friend.pb.cc:483: undefined reference to google::protobuf::internal::WireFormat::InternalSerializeUnknownFieldsToArray(google::protobuf::UnknownFieldSet const&, unsigned char*, google::protobuf::io::EpsCopyOutputStream*)' /usr/bin/ld: CMakeFiles/provider.dir//friend.pb.cc.o: in function fixbug::GetFriendsListRequest::ByteSizeLong() const':
/home/dai/Study_Linux/c++cpp/rpc分布式/KVstorageBaseRaft-cpp-main/example/rpcExample/friend.pb.cc:506: undefined reference to google::protobuf::internal::ComputeUnknownFieldsSize(google::protobuf::internal::InternalMetadata const&, unsigned long, google::protobuf::internal::CachedSize*)' /usr/bin/ld: CMakeFiles/provider.dir//friend.pb.cc.o: in function fixbug::GetFriendsListResponse::GetFriendsListResponse(google::protobuf::Arena*)':
/home/dai/Study_Linux/c++cpp/rpc分布式/KVstorageBaseRaft-cpp-main/example/rpcExample/friend.pb.cc:587: undefined reference to google::protobuf::RepeatedPtrField<std::cxx11::basic_string<char, std::char_traits, std::allocator > >::RepeatedPtrField(google::protobuf::Arena*)' /usr/bin/ld: /home/dai/Study_Linux/c++cpp/rpc分布式/KVstorageBaseRaft-cpp-main/example/rpcExample/friend.pb.cc:587: undefined reference to google::protobuf::RepeatedPtrField<std::cxx11::basic_string<char, std::char_traits, std::allocator > >::~RepeatedPtrField()'
/usr/bin/ld: CMakeFiles/provider.dir//friend.pb.cc.o: in function fixbug::GetFriendsListResponse::GetFriendsListResponse(fixbug::GetFriendsListResponse const&)': /home/dai/Study_Linux/c++cpp/rpc分布式/KVstorageBaseRaft-cpp-main/example/rpcExample/friend.pb.cc:594: undefined reference to google::protobuf::RepeatedPtrField<std::cxx11::basic_string<char, std::char_traits, std::allocator > >::RepeatedPtrField(google::protobuf::RepeatedPtrField<std::cxx11::basic_string<char, std::char_traits, std::allocator > > const&)'
/usr/bin/ld: /home/dai/Study_Linux/c++cpp/rpc分布式/KVstorageBaseRaft-cpp-main/example/rpcExample/friend.pb.cc:594: undefined reference to google::protobuf::RepeatedPtrField<std::cxx11::basic_string<char, std::char_traits, std::allocator > >::~RepeatedPtrField()' /usr/bin/ld: CMakeFiles/provider.dir//friend.pb.cc.o: in function fixbug::GetFriendsListResponse::~GetFriendsListResponse()':
/home/dai/Study_Linux/c++cpp/rpc分布式/KVstorageBaseRaft-cpp-main/example/rpcExample/friend.pb.cc:609: undefined reference to google::protobuf::RepeatedPtrField<std::cxx11::basic_string<char, std::char_traits, std::allocator > >::~RepeatedPtrField()' /usr/bin/ld: CMakeFiles/provider.dir//friend.pb.cc.o: in function fixbug::GetFriendsListResponse::Clear()':
/home/dai/Study_Linux/c++cpp/rpc分布式/KVstorageBaseRaft-cpp-main/example/rpcExample/friend.pb.cc:641: undefined reference to google::protobuf::RepeatedPtrField<std::cxx11::basic_string<char, std::char_traits, std::allocator > >::Clear()' /usr/bin/ld: CMakeFiles/provider.dir//friend.pb.cc.o: in function fixbug::GetFriendsListResponse::_InternalParse(char const*, google::protobuf::internal::ParseContext*)':
/home/dai/Study_Linux/c++cpp/rpc分布式/KVstorageBaseRaft-cpp-main/example/rpcExample/friend.pb.cc:671: undefined reference to google::protobuf::internal::InlineGreedyStringParser(std::cxx11::basic_string<char, std::char_traits, std::allocator >, char const, google::protobuf::internal::ParseContext*)' /usr/bin/ld: /home/dai/Study_Linux/c++cpp/rpc分布式/KVstorageBaseRaft-cpp-main/example/rpcExample/friend.pb.cc:683: undefined reference to google::protobuf::internal::UnknownFieldParse(unsigned long, google::protobuf::UnknownFieldSet*, char const*, google::protobuf::internal::ParseContext*)'
/usr/bin/ld: CMakeFiles/provider.dir//friend.pb.cc.o: in function fixbug::GetFriendsListResponse::_InternalSerialize(unsigned char*, google::protobuf::io::EpsCopyOutputStream*) const': /home/dai/Study_Linux/c++cpp/rpc分布式/KVstorageBaseRaft-cpp-main/example/rpcExample/friend.pb.cc:720: undefined reference to google::protobuf::internal::WireFormat::InternalSerializeUnknownFieldsToArray(google::protobuf::UnknownFieldSet const&, unsigned char*, google::protobuf::io::EpsCopyOutputStream*)'
/usr/bin/ld: CMakeFiles/provider.dir//friend.pb.cc.o: in function fixbug::GetFriendsListResponse::ByteSizeLong() const': /home/dai/Study_Linux/c++cpp/rpc分布式/KVstorageBaseRaft-cpp-main/example/rpcExample/friend.pb.cc:737: undefined reference to google::protobuf::RepeatedPtrField<std::cxx11::basic_string<char, std::char_traits, std::allocator > >::size() const'
/usr/bin/ld: /home/dai/Study_Linux/c++cpp/rpc分布式/KVstorageBaseRaft-cpp-main/example/rpcExample/friend.pb.cc:738: undefined reference to google::protobuf::RepeatedPtrField<std::cxx11::basic_string<char, std::char_traits, std::allocator > >::size() const' /usr/bin/ld: /home/dai/Study_Linux/c++cpp/rpc分布式/KVstorageBaseRaft-cpp-main/example/rpcExample/friend.pb.cc:740: undefined reference to google::protobuf::RepeatedPtrField<std::cxx11::basic_string<char, std::char_traits, std::allocator > >::Get(int) const'
/usr/bin/ld: /home/dai/Study_Linux/c++cpp/rpc分布式/KVstorageBaseRaft-cpp-main/example/rpcExample/friend.pb.cc:751: undefined reference to google::protobuf::internal::ComputeUnknownFieldsSize(google::protobuf::internal::InternalMetadata const&, unsigned long, google::protobuf::internal::CachedSize*)' /usr/bin/ld: CMakeFiles/provider.dir//friend.pb.cc.o: in function fixbug::GetFriendsListResponse::MergeFrom(fixbug::GetFriendsListResponse const&)':
/home/dai/Study_Linux/c++cpp/rpc分布式/KVstorageBaseRaft-cpp-main/example/rpcExample/friend.pb.cc:781: undefined reference to google::protobuf::RepeatedPtrField<std::cxx11::basic_string<char, std::char_traits, std::allocator > >::MergeFrom(google::protobuf::RepeatedPtrField<std::cxx11::basic_string<char, std::char_traits, std::allocator > > const&)' /usr/bin/ld: CMakeFiles/provider.dir//friend.pb.cc.o: in function fixbug::GetFriendsListResponse::InternalSwap(fixbug::GetFriendsListResponse*)':
/home/dai/Study_Linux/c++cpp/rpc分布式/KVstorageBaseRaft-cpp-main/example/rpcExample/friend.pb.cc:808: undefined reference to google::protobuf::RepeatedPtrField<std::cxx11::basic_string<char, std::char_traits, std::allocator > >::InternalSwap(google::protobuf::RepeatedPtrField<std::cxx11::basic_string<char, std::char_traits, std::allocator > >*)' /usr/bin/ld: CMakeFiles/provider.dir//friend.pb.cc.o: in function fixbug::FiendServiceRpc::descriptor()':
/home/dai/Study_Linux/c++cpp/rpc分布式/KVstorageBaseRaft-cpp-main/example/rpcExample/friend.pb.cc:822: undefined reference to google::protobuf::internal::AssignDescriptors(google::protobuf::internal::DescriptorTable const*, bool)' /usr/bin/ld: CMakeFiles/provider.dir//friend.pb.cc.o: in function void* google::protobuf::Arena::AllocateInternalfixbug::ResultCode(bool)':
/usr/local/include/google/protobuf/arena.h:536: undefined reference to google::protobuf::Arena::AllocateAlignedNoHook(unsigned long)' /usr/bin/ld: CMakeFiles/provider.dir//friend.pb.cc.o: in function void* google::protobuf::Arena::AllocateInternalfixbug::GetFriendsListRequest(bool)':
/usr/local/include/google/protobuf/arena.h:536: undefined reference to google::protobuf::Arena::AllocateAlignedNoHook(unsigned long)' /usr/bin/ld: CMakeFiles/provider.dir//friend.pb.cc.o: in function void* google::protobuf::Arena::AllocateInternalfixbug::GetFriendsListResponse(bool)':
/usr/local/include/google/protobuf/arena.h:536: undefined reference to google::protobuf::Arena::AllocateAlignedNoHook(unsigned long)' /usr/bin/ld: CMakeFiles/provider.dir//friend.pb.cc.o: in function static_initialization_and_destruction_0(int, int)':
/home/dai/Study_Linux/c++cpp/rpc分布式/KVstorageBaseRaft-cpp-main/example/rpcExample/friend.pb.cc:139: undefined reference to google::protobuf::internal::AddDescriptors(google::protobuf::internal::DescriptorTable const*)' /usr/bin/ld: CMakeFiles/provider.dir//friend.pb.cc.o: in function google::protobuf::io::EpsCopyOutputStream::EnsureSpace(unsigned char*)':
/usr/local/include/google/protobuf/io/coded_stream.h:690: undefined reference to google::protobuf::io::EpsCopyOutputStream::EnsureSpaceFallback(unsigned char*)' /usr/bin/ld: CMakeFiles/provider.dir//friend.pb.cc.o: in function google::protobuf::io::EpsCopyOutputStream::WriteStringMaybeAliased(unsigned int, std::cxx11::basic_string<char, std::char_traits, std::allocator > const&, unsigned char*)':
/usr/local/include/google/protobuf/io/coded_stream.h:719: undefined reference to google::protobuf::io::EpsCopyOutputStream::WriteStringMaybeAliasedOutline(unsigned int, std::cxx11::basic_string<char, std::char_traits, std::allocator > const&, unsigned char*)' /usr/bin/ld: CMakeFiles/provider.dir//friend.pb.cc.o: in function google::protobuf::internal::EpsCopyInputStream::DoneWithCheck(char const**, int)':
/usr/local/include/google/protobuf/parse_context.h:213: undefined reference to google::protobuf::internal::EpsCopyInputStream::DoneFallback(char const*, int)' /usr/bin/ld: CMakeFiles/provider.dir//friend.pb.cc.o: in function google::protobuf::internal::VarintParseSlow(char const*, unsigned int, unsigned int*)':
/usr/local/include/google/protobuf/parse_context.h:464: undefined reference to google::protobuf::internal::VarintParseSlow32(char const*, unsigned int)' /usr/bin/ld: CMakeFiles/provider.dir//friend.pb.cc.o: in function google::protobuf::internal::VarintParseSlow(char const*, unsigned int, unsigned long*)':
/usr/local/include/google/protobuf/parse_context.h:470: undefined reference to google::protobuf::internal::VarintParseSlow64(char const*, unsigned int)' /usr/bin/ld: CMakeFiles/provider.dir//friend.pb.cc.o: in function google::protobuf::internal::ReadTag(char const*, unsigned int*, unsigned int)':
/usr/local/include/google/protobuf/parse_context.h:511: undefined reference to google::protobuf::internal::ReadTagFallback(char const*, unsigned int)' /usr/bin/ld: CMakeFiles/provider.dir//friend.pb.cc.o: in function google::protobuf::internal::ReadSize(char const**)':
/usr/local/include/google/protobuf/parse_context.h:573: undefined reference to google::protobuf::internal::ReadSizeFallback(char const*, unsigned int)' /usr/bin/ld: CMakeFiles/provider.dir//friend.pb.cc.o: in function fixbug::ResultCode::GetMetadataStatic()':
/home/dai/Study_Linux/c++cpp/rpc分布式/KVstorageBaseRaft-cpp-main/example/rpcExample/friend.pb.h:180: undefined reference to google::protobuf::internal::AssignDescriptors(google::protobuf::internal::DescriptorTable const*, bool)' /usr/bin/ld: CMakeFiles/provider.dir//friend.pb.cc.o: in function fixbug::GetFriendsListRequest::GetMetadataStatic()':
/home/dai/Study_Linux/c++cpp/rpc分布式/KVstorageBaseRaft-cpp-main/example/rpcExample/friend.pb.h:344: undefined reference to google::protobuf::internal::AssignDescriptors(google::protobuf::internal::DescriptorTable const*, bool)' /usr/bin/ld: CMakeFiles/provider.dir//friend.pb.cc.o: in function fixbug::GetFriendsListResponse::GetMetadataStatic()':
/home/dai/Study_Linux/c++cpp/rpc分布式/KVstorageBaseRaft-cpp-main/example/rpcExample/friend.pb.h:481: undefined reference to google::protobuf::internal::AssignDescriptors(google::protobuf::internal::DescriptorTable const*, bool)' /usr/bin/ld: CMakeFiles/provider.dir//friend.pb.cc.o: in function fixbug::GetFriendsListResponse::_internal_friends_size() const':
/home/dai/Study_Linux/c++cpp/rpc分布式/KVstorageBaseRaft-cpp-main/example/rpcExample/friend.pb.h:831: undefined reference to google::protobuf::RepeatedPtrField<std::cxx11::basic_string<char, std::char_traits, std::allocator > >::size() const' /usr/bin/ld: CMakeFiles/provider.dir//friend.pb.cc.o: in function fixbug::GetFriendsListResponse::_internal_friendsabi:cxx11 const':
/home/dai/Study_Linux/c++cpp/rpc分布式/KVstorageBaseRaft-cpp-main/example/rpcExample/friend.pb.h:844: undefined reference to google::protobuf::RepeatedPtrField<std::cxx11::basic_string<char, std::char_traits, std::allocator > >::Get(int) const' /usr/bin/ld: CMakeFiles/provider.dir//friend.pb.cc.o: in function unsigned char* google::protobuf::io::EpsCopyOutputStream::WriteString<std::__cxx11::basic_string<char, std::char_traits, std::allocator > >(unsigned int, std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, unsigned char*)':
/usr/local/include/google/protobuf/io/coded_stream.h:736: undefined reference to google::protobuf::io::EpsCopyOutputStream::WriteStringOutline(unsigned int, std::cxx11::basic_string<char, std::char_traits, std::allocator > const&, unsigned char*)' /usr/bin/ld: CMakeFiles/provider.dir//friend.pb.cc.o: in function void* google::protobuf::Arena::AllocateInternal<google::protobuf::internal::InternalMetadata::Containergoogle::protobuf::UnknownFieldSet >(bool)':
/usr/local/include/google/protobuf/arena.h:536: undefined reference to google::protobuf::Arena::AllocateAlignedNoHook(unsigned long)' /usr/bin/ld: ../../../../lib/librpc_lib.a(mprpcchannel.cpp.o): in function google::protobuf::io::EpsCopyOutputStream::WriteRaw(void const*, int, unsigned char*)':
/usr/local/include/google/protobuf/io/coded_stream.h:697: undefined reference to google::protobuf::io::EpsCopyOutputStream::WriteRawFallback(void const*, int, unsigned char*)' /usr/bin/ld: ../../../../lib/librpc_lib.a(rpcheader.pb.cpp.o): in function RPC::RpcHeader::_InternalParse(char const*, google::protobuf::internal::ParseContext*)':
/home/dai/Study_Linux/c++cpp/rpc分布式/KVstorageBaseRaft-cpp-main/src/rpc/rpcheader.pb.cpp:182: undefined reference to google::protobuf::internal::InlineGreedyStringParser(std::__cxx11::basic_string<char, std::char_traits, std::allocator >, char const, google::protobuf::internal::ParseContext*)' /usr/bin/ld: /home/dai/Study_Linux/c++cpp/rpc分布式/KVstorageBaseRaft-cpp-main/src/rpc/rpcheader.pb.cpp:191: undefined reference to google::protobuf::internal::InlineGreedyStringParser(std::__cxx11::basic_string<char, std::char_traits, std::allocator >, char const, google::protobuf::internal::ParseContext*)'
/usr/bin/ld: /home/dai/Study_Linux/c++cpp/rpc分布式/KVstorageBaseRaft-cpp-main/src/rpc/rpcheader.pb.cpp:210: undefined reference to google::protobuf::internal::UnknownFieldParse(unsigned long, google::protobuf::UnknownFieldSet*, char const*, google::protobuf::internal::ParseContext*)' /usr/bin/ld: ../../../../lib/librpc_lib.a(rpcheader.pb.cpp.o): in function RPC::RpcHeader::_InternalSerialize(unsigned char*, google::protobuf::io::EpsCopyOutputStream*) const':
/home/dai/Study_Linux/c++cpp/rpc分布式/KVstorageBaseRaft-cpp-main/src/rpc/rpcheader.pb.cpp:249: undefined reference to google::protobuf::internal::WireFormat::InternalSerializeUnknownFieldsToArray(google::protobuf::UnknownFieldSet const&, unsigned char*, google::protobuf::io::EpsCopyOutputStream*)' /usr/bin/ld: ../../../../lib/librpc_lib.a(rpcheader.pb.cpp.o): in function RPC::RpcHeader::ByteSizeLong() const':
/home/dai/Study_Linux/c++cpp/rpc分布式/KVstorageBaseRaft-cpp-main/src/rpc/rpcheader.pb.cpp:282: undefined reference to google::protobuf::internal::ComputeUnknownFieldsSize(google::protobuf::internal::InternalMetadata const&, unsigned long, google::protobuf::internal::CachedSize*)' /usr/bin/ld: ../../../../lib/librpc_lib.a(rpcheader.pb.cpp.o): in function void* google::protobuf::Arena::AllocateInternalRPC::RpcHeader(bool)':
/usr/local/include/google/protobuf/arena.h:536: undefined reference to google::protobuf::Arena::AllocateAlignedNoHook(unsigned long)' /usr/bin/ld: ../../../../lib/librpc_lib.a(rpcheader.pb.cpp.o): in function __static_initialization_and_destruction_0(int, int)':
/home/dai/Study_Linux/c++cpp/rpc分布式/KVstorageBaseRaft-cpp-main/src/rpc/rpcheader.pb.cpp:95: undefined reference to google::protobuf::internal::AddDescriptors(google::protobuf::internal::DescriptorTable const*)' /usr/bin/ld: ../../../../lib/librpc_lib.a(rpcheader.pb.cpp.o): in function RPC::RpcHeader::GetMetadataStatic()':
/home/dai/Study_Linux/c++cpp/rpc分布式/KVstorageBaseRaft-cpp-main/src/rpc/include/rpcheader.pb.h:171: undefined reference to `google::protobuf::internal::AssignDescriptors(google::protobuf::internal::DescriptorTable const*, bool)'
collect2: error: ld returned 1 exit status
make[2]: *** [example/rpcExample/callee/CMakeFiles/provider.dir/build.make:100:../bin/provider] 错误 1
make[1]: *** [CMakeFiles/Makefile2:585:example/rpcExample/callee/CMakeFiles/provider.dir/all] 错误 2
make: *** [Makefile:84:all] 错误 2
请问这怎么解决呢