0

I am trying to compile make file with gcc 9.3.0 and here is a small part of the error I encounter

make: Entering directory '/home/ross/serpentine-env/src'
protobuf/veinsgym.pb.cc
Creating executable: out/gcc-debug//experiment_dbg
/usr/bin/ld: out/gcc-debug//protobuf/veinsgym.pb.o: in function `veinsgym::proto::Request::_InternalParse(char const*, google::protobuf::internal::ParseContext*)':
/home/ross/serpentine-env/src/protobuf/veinsgym.pb.cc:563: undefined reference to `google::protobuf::internal::ParseContext::ParseMessage(google::protobuf::MessageLite*, char const*)'
/usr/bin/ld: /home/ross/serpentine-env/src/protobuf/veinsgym.pb.cc:571: undefined reference to `google::protobuf::internal::ParseContext::ParseMessage(google::protobuf::MessageLite*, char const*)'
/usr/bin/ld: /home/ross/serpentine-env/src/protobuf/veinsgym.pb.cc:579: undefined reference to `google::protobuf::internal::ParseContext::ParseMessage(google::protobuf::MessageLite*, char const*)'
/usr/bin/ld: /home/ross/serpentine-env/src/protobuf/veinsgym.pb.cc:593: undefined reference to `google::protobuf::internal::UnknownFieldParse(unsigned long, google::protobuf::UnknownFieldSet*, char const*, google::protobuf::internal::ParseContext*)'

Essentially, this error is then repeated with many different methods of the class e.g.,

/usr/bin/ld: out/gcc-debug//protobuf/veinsgym.pb.o: in function `veinsgym::proto::Request::_InternalSerialize(unsigned char*, google::protobuf::io::EpsCopyOutputStream*) const':
/home/ross/serpentine-env/src/protobuf/veinsgym.pb.cc:644: undefined reference to `google::protobuf::internal::WireFormat::InternalSerializeUnknownFieldsToArray(google::protobuf::UnknownFieldSet const&, unsigned char*, google::protobuf::io::EpsCopyOutputStream*)'
/usr/bin/ld: out/gcc-debug//protobuf/veinsgym.pb.o: in function `veinsgym::proto::Request::ByteSizeLong() const':
/home/ross/serpentine-env/src/protobuf/veinsgym.pb.cc:690: undefined reference to `google::protobuf::Message::MaybeComputeUnknownFieldsSize(unsigned long, google::protobuf::internal::CachedSize*) const'
/usr/bin/ld: out/gcc-debug//protobuf/veinsgym.pb.o: in function `veinsgym::proto::Request::GetMetadata() const':
/home/ross/serpentine-env/src/protobuf/veinsgym.pb.cc:757: undefined reference to `google::protobuf::internal::AssignDescriptors(google::protobuf::internal::DescriptorTable const* (*)(), std::once_flag*, google::protobuf::Metadata const&)'
/usr/bin/ld: out/gcc-debug//protobuf/veinsgym.pb.o: in function `veinsgym::proto::Reply::_InternalParse(char const*, google::protobuf::internal::ParseContext*)':
/home/ross/serpentine-env/src/protobuf/veinsgym.pb.cc:946: undefined reference to `google::protobuf::internal::ParseContext::ParseMessage(google::protobuf::MessageLite*, char const*)'
/usr/bin/ld: /home/ross/serpentine-env/src/protobuf/veinsgym.pb.cc:954: undefined reference to `google::protobuf::internal::ParseContext::ParseMessage(google::protobuf::MessageLite*, char const*)'
/usr/bin/ld: /home/ross/serpentine-env/src/protobuf/veinsgym.pb.cc:962: undefined reference to `google::protobuf::internal::ParseContext::ParseMessage(google::protobuf::MessageLite*, char const*)'
/usr/bin/ld: /home/ross/serpentine-env/src/protobuf/veinsgym.pb.cc:976: undefined reference to `google::protobuf::internal::UnknownFieldParse(unsigned long, google::protobuf::UnknownFieldSet*, char const*, google::protobuf::internal::ParseContext*)'

and so on.
I guess there is some problem in the linker, since the error metiones usr/bin/ld, but I cannot solve it on my own. Following the error trace, I went to google/protobuf/ directory, but I did not find internal directory mentioned in the error. Maybe it was removed in later releases and thus it is version compatibility problem?

Thank you in advance!

Python
  • 339
  • 1
  • 8
  • Use the compiler and linker flags retrieved by `pkg-config --cflags --libs protobuf`. – 273K Jan 08 '22 at 19:08

0 Answers0