-
Notifications
You must be signed in to change notification settings - Fork 133
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
环境配置过程分享|protoc muduo boost #28
Comments
Message that will be displayed on users' first issue |
感谢分享,欢迎提个pr到README文件来给仓库贡献一波 @Sudingyi |
@daishiqiang123 我认为问题还是出在protoc版本上,你的
输出是libprotoc 3.12.4吗 |
你好,我的protoc版本输出确实是3.12.4,ubuntu为20.04,所以不明确到底哪里出问题了
…---- 回复的原邮件 ----
| 发件人 | ***@***.***> |
| 日期 | 2024年04月21日 17:54 |
| 收件人 | ***@***.***> |
| 抄送至 | ***@***.***>***@***.***> |
| 主题 | Re: [youngyangyang04/KVstorageBaseRaft-cpp] 环境配置过程分享|protoc muduo boost (Issue #28) |
你好,我也是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
请问这怎么解决呢
@daishiqiang123 我认为问题还是出在protoc版本上,你的
protoc --version
输出是libprotoc 3.12.4吗
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
@daishiqiang123 我也感到奇怪。 |
我利用proto文件重新生成cpp文件,粗略看发现和之前没什么区别,重新编译之后还是遇到上述问题,太奇怪了 |
3.12.x的版本我都试过了,依然出现这种问题 |
@daishiqiang123 我暂时也没有太好的思路解决这个问题。 |
好的,我排除了中文路径,但依然很会出现这个问题 |
我尝试手动添加protobuf库,就编译成功了 |
很奇怪,按理说编译的时候的默认搜索路径就有 |
【已在下一帖解决,又遇到新问题】在muduo 下运行./build.sh中遇到以下报错 环境:Ubuntu20.04 [ 41%] Linking CXX executable ../../../bin/protobuf_rpc_wire_test |
同上 使用 现在又遇到新问题,执行 环境同上没变,仍然和protobuf有关。。。没头绪啊,这种问题应该怎么解决 |
在仔细阅读protoc使用教程后意识到报错均来自 friend.pb.h、friend.pb.cc等由protoc complier自主生成的文件,报错均为undefined reference,意识到example文件夹下的friend.protoc是由作者预编译的,这里可能有某种bug。遂删除example/rpcExample/ 下的friend.pb.h、friend.pb.cc,使用 protoc friend.proto --cpp_out=. ,重新编译。最终成功make |
@WalkLull 感谢反馈。 |
分享一下我几经波折的环境配置过程,我觉得我踩了大部分的坑(一开始用的windows环境缺乏<sys/socket.h>)
这里发现版本不合适,目前我的版本为libprotoc 3.19.1
项目的版本为
protoc安装传送门:https://github.com/protocolbuffers/protobuf/releases/tag/v3.12.4
boost muduo安装传送门: https://blog.csdn.net/qq_41453285/article/details/105104845
注意:对于muduo编译生成的静态文件需要移动到根目录下../build/release-cpp11/lib不然会报这个错误
错误截图:
最后成功啦,成功的截图:
The text was updated successfully, but these errors were encountered: