protobuf 库在消息实例化时抛出 FatalException

问题描述 投票:0回答:2

我正在从源代码编译 protobuf 3.6.1 并链接到针对 Ubuntu 16.04 的可执行文件。一旦创建任何消息类型的对象,库就会抛出异常并显示以下控制台输出:

[libprotobuf FATAL /myproj/protobuf/src/google/protobuf/ generated_message_util.cc:785] 检查失败:(scc->visit_status.load(std::memory_order_relaxed)) == (SCCInfoBase::kRunning):
在抛出 'google::protobuf::FatalException' 实例后调用终止
什么():检查失败:(scc->visit_status.load(std :: memory_order_relaxed))==(SCCInfoBase :: kRunning):
已中止

c++ linux protocol-buffers
2个回答
1
投票

here所述,您需要运行

pkg-config
或以其他方式确定在使用protobuf的项目中使用哪些构建标志。在这种特殊情况下,缺少 pthread 库。


0
投票

我尝试在编译命令后添加-pthread,发现编译后可以正常执行。

© www.soinside.com 2019 - 2024. All rights reserved.