Facing undefined reference error after upgrading Protobuf

1.6k Views Asked by At

I had upgraded the protoc version from 3.0.0 to 3.15.2 . Now I am unable to compile the program that uses protoc output files(*.pb.cpp , *.pb.h). I am getting the error as shown below:

In function `google::protobuf::io::EpsCopyOutputStream::EnsureSpace(unsigned char*)':
/usr/local/include/google/protobuf/io/coded_stream.h:694: undefined reference to `google::protobuf::io::EpsCopyOutputStream::EnsureSpaceFallback(unsigned char*)'

 In function `google::protobuf::internal::TaggedPtr<std::string>::Set(std::string*)':
/usr/local/include/google/protobuf/arenastring.h:101: undefined reference to `google::protobuf::internal::fixed_address_empty_string'

 In function `google::protobuf::Arena::AllocateAlignedWithHook(unsigned long, unsigned long, std::type_info const*)':
/usr/local/include/google/protobuf/arena.h:700: undefined reference to `google::protobuf::Arena::AllocateAlignedWithHook(unsigned long, std::type_info const*)'

 In function `google::protobuf::internal::ReadTag(char const*, unsigned int*, unsigned int)':
/usr/local/include/google/protobuf/parse_context.h:544: undefined reference to `google::protobuf::internal::ReadTagFallback(char const*, unsigned int)'

 In function `google::protobuf::Arena::SpaceAllocated() const':
/usr/local/include/google/protobuf/arena.h:349: undefined reference to `google::protobuf::internal::ThreadSafeArena::SpaceAllocated() const'

 In function `google::protobuf::UnknownFieldSet::Clear()':
/usr/local/include/google/protobuf/unknown_field_set.h:312: undefined reference to `google::protobuf::UnknownFieldSet::ClearFallback()'

I am facing this undefined reference error in google::protobuf path . There are so many lines of same errors of the kind show above. Do I have to include any other additional library for the upgraded version ? or Do I have to change path of any library ? as here undefined reference to google protobuf

Any kind of help with respect to this is appreciated .

Thank you

0

There are 0 best solutions below