muduo-protorpc
muduo-protorpc copied to clipboard
muduo-protorpc编译失败
ubuntu环境: Linux version 5.4.0-42-generic (buildd@lgw01-amd64-038) (gcc version 9.3.0 (Ubuntu 9.3.0-10ubuntu2)) #46-Ubuntu SMP Fri Jul 10 00:24:02 UTC 2020 Distributor ID: Ubuntu Description: Ubuntu 20.04.1 LTS Release: 20.04
protorpc环境: protoc --version libprotoc 3.19.4
发生问题的操作:
执行:
$ sudo apt-get install libprotoc-dev protobuf-compiler
$ sudo apt-get install libprotobuf-dev cmake
$ git clone https://github.com/chenshuo/muduo.git
$ git clone https://github.com/chenshuo/muduo-protorpc.git
在执行完上述操作后,执行:
cd muduo && git checkout cpp11 && ./build.sh install
报错:
[ 35%] Built target timerqueue_unittest
[ 36%] Built target muduo_protobuf_codec
[ 37%] Built target muduo_protorpc_wire
[ 37%] Built target muduo_protorpc
[ 37%] Linking CXX executable ../../../bin/protobuf_rpc_wire_test
/usr/bin/ld: ../../../lib/libmuduo_protorpc_wire.a(rpc.pb.cc.o): in function muduo::net::RpcMessage::SharedDtor()': /home/cambricon/study/fmuduo/build/release-cpp11/muduo/net/protorpc/rpc.pb.cc:260: undefined reference to
google::protobuf::internal::ArenaStringPtr::Destroy()'
/usr/bin/ld: /home/cambricon/study/fmuduo/build/release-cpp11/muduo/net/protorpc/rpc.pb.cc:261: undefined reference to google::protobuf::internal::ArenaStringPtr::Destroy()' /usr/bin/ld: /home/cambricon/study/fmuduo/build/release-cpp11/muduo/net/protorpc/rpc.pb.cc:262: undefined reference to
google::protobuf::internal::ArenaStringPtr::Destroy()'
/usr/bin/ld: /home/cambricon/study/fmuduo/build/release-cpp11/muduo/net/protorpc/rpc.pb.cc:263: undefined reference to google::protobuf::internal::ArenaStringPtr::Destroy()' /usr/bin/ld: ../../../lib/libmuduo_protorpc_wire.a(rpc.pb.cc.o): in function
muduo::net::RpcMessage::_internal_mutable_responseabi:cxx11':
/home/cambricon/study/fmuduo/build/release-cpp11/muduo/net/protorpc/rpc.pb.h:690: undefined reference to google::protobuf::internal::ArenaStringPtr::Mutable[abi:cxx11](google::protobuf::Arena*)' /usr/bin/ld: ../../../lib/libmuduo_protorpc_wire.a(rpc.pb.cc.o): in function
muduo::net::RpcMessage::RpcMessage(muduo::net::RpcMessage const&)':
/home/cambricon/study/fmuduo/build/release-cpp11/muduo/net/protorpc/rpc.pb.cc:216: undefined reference to google::protobuf::internal::ArenaStringPtr::Set(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, google::protobuf::Arena*)' /usr/bin/ld: /home/cambricon/study/fmuduo/build/release-cpp11/muduo/net/protorpc/rpc.pb.cc:208: undefined reference to
google::protobuf::internal::ArenaStringPtr::Set(std::__cxx11::basic_string<char, std::char_traitsgoogle::protobuf::internal::ArenaStringPtr::Set(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, google::protobuf::Arena*)' /usr/bin/ld: /home/cambricon/study/fmuduo/build/release-cpp11/muduo/net/protorpc/rpc.pb.cc:192: undefined reference to
google::protobuf::internal::ArenaStringPtr::Set(std::__cxx11::basic_string<char, std::char_traitsmuduo::net::RpcMessage::_internal_set_method(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)': /home/cambricon/study/fmuduo/build/release-cpp11/muduo/net/protorpc/rpc.pb.h:550: undefined reference to
google::protobuf::internal::ArenaStringPtr::Set(std::__cxx11::basic_string<char, std::char_traits
ps: 电脑上的protocbuff是提前装好了,但是还是执行了 $ sudo apt-get install libprotoc-dev protobuf-compiler $ sudo apt-get install libprotobuf-dev cmake 这两个命令 另外,在编译muduo-protorpc之前,我基于手动安装过的protoc版本去编译muduo是可以编译通过的,并且 example下面的rpc有关的可执行文件在bin中都是正常生成的 所以不确定是那里操作有问题?
ps 在master和cpp11这两个分支下都尝试过了,报相同的错误
我也是,这个错误就是一直无法解决。未定义错误好奇怪
我也是,这个错误就是一直无法解决。未定义错误好奇怪
是的,我已经放弃了,另外,golang还是比较好用