protobuf在使用的时候使用静态链接库方式

protobuf默认安装的时候,configure使用的是使用动态链接库的方式进行安装和使用的,在使用过程中,会报出这个错误:[libprotobuf ERROR google/protobuf/descriptor_database.cc:57] File already exists in database: pro_projectasset.proto[libprotobuf FATA...
摘要由CSDN通过智能技术生成

protobuf默认安装的时候,configure使用的是使用动态链接库的方式进行安装和使用的,在使用过程中,会报出这个错误:

[libprotobuf ERROR google/protobuf/descriptor_database.cc:57] File already exists in database: pro_projectasset.proto
[libprotobuf FATAL google/protobuf/descriptor.cc:1164] CHECK failed: generated_database_->Add(encoded_file_descriptor, size): 
terminate called after throwing an instance of 'google::protobuf::FatalException'
  what():  CHECK failed: generated_database_->Add(encoded_file_descriptor, size): 

 

当时自己并没有搞清楚问题的根源。在网上看到是可以通过将protobuf链接的时候改成静态链接库的方式进行。后续跟进

这里先记录一下问题的解决方案:

方案一:

即是对protobuf重新编绎安装,步骤如下:

编译google protobuff时,在configure 时加上选项:
configrue --disable-shared
即可编译成静态库

  • 3
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值