升级 Protobuf 后面临未定义的引用错误

问题描述

我已将 protoc 版本从 3.0.0 升级3.15.2 。现在我无法编译使用 protoc 输出文件(*.pb.cpp、*.pb.h)的程序。我收到如下所示的错误

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()'

我在 google::protobuf 路径中遇到了这个 未定义的引用 错误。上面显示了很多相同的错误行我是否必须为升级版本包含任何其他附加库? 要么 我是否必须更改任何库的路径?如此处undefined reference to google protobuf

对此的任何帮助表示赞赏。

谢谢

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...