chenshuo / muduo

Event-driven network library for multi-threaded Linux server in C++11
https://github.com/chenshuo/muduo
Other
14.64k stars 5.14k forks source link

安装问题:protobuf3.x版本 #687

Closed frankwang98 closed 1 year ago

frankwang98 commented 1 year ago

请问后面会支持protobuf 3.x版本吗?

当前源码编译的protobuf3.19,编译报错部分:

Scanning dependencies of target protobuf_rpc_wire_test [ 40%] Building CXX object muduo/net/protorpc/CMakeFiles/protobuf_rpc_wire_test.dir/RpcCodec_test.cc.o [ 40%] Linking CXX executable ../../../bin/protobuf_rpc_wire_test /usr/bin/ld: ../../../lib/libmuduo_protorpc_wire.a(rpc.pb.cc.o): in functiongoogle::protobuf::Arena::~Arena()': /usr/local/include/google/protobuf/arena.h:272: undefined reference to google::protobuf::internal::ThreadSafeArena::~ThreadSafeArena()'

Rockermankind commented 1 year ago

请问后面会支持protobuf 3.x版本吗?

当前源码编译的protobuf3.19,编译报错部分:

Scanning dependencies of target protobuf_rpc_wire_test [ 40%] Building CXX object muduo/net/protorpc/CMakeFiles/protobuf_rpc_wire_test.dir/RpcCodec_test.cc.o [ 40%] Linking CXX executable ../../../bin/protobuf_rpc_wire_test /usr/bin/ld: ../../../lib/libmuduo_protorpc_wire.a(rpc.pb.cc.o): in functiongoogle::protobuf::Arena::~Arena()': /usr/local/include/google/protobuf/arena.h:272: undefined reference to google::protobuf::internal::ThreadSafeArena::~ThreadSafeArena()'

现在要暂时解决问题的话建议把CMakeList.txt中的find_package(protobuf)给注释了,现在protobuf不支持cxx14以下的版本,就算添加了14的编译也是一堆的protorpc报错,不如直接规避问题。