protobuf3安装及使用(报错解决)

本文详细介绍了从下载到安装Protobuf的过程,包括配置、编译和测试步骤。同时,针对安装过程中可能出现的错误,如编译报错和加载共享库失败等问题,提供了具体的解决方案。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

1.安装

下载地址 https://github.com/protocolbuffers/protobuf/releases  (我下载的是all版本  tar.gz)

tar zvxf ******.tar.gz
cd protobuf-******
 
./configure –prefix=/usr/local/
 
sudo make          #编译时间很长
sudo make check
sudo make install

2.测试是否可用

可参考https://blog.csdn.net/lcuwb/article/details/90705397  (如果编译报错,记得回来看下面的内容)

3.报错解决

[libprotobuf FATAL google/protobuf/generated_message_util.cc:812] CHECK failed: (scc->visit_status.load(std::memory_order_relaxed)) == (SCCInfoBase::kRunning): 
terminate called after throwing an instance of 'google::protobuf::FatalException'
// 解决方法:  编译时加上  -lpthread
error while loading shared libraries: libprotobuf.so.******
// 解决方法:https://blog.csdn.net/weixin_37251044/article/details/79139906
// 参考上链接的 1和3步

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值