gcc-3.4编译google protocol buffer 2.4.0a

gcc 3.4是比较老的编译器,用它来编译最新版protobuf 2.4.0a的话,可能会有如下错误:

google/protobuf/descriptor.cc: In member function `virtual const google::protobuf::FieldDescriptor* google::protobuf::DescriptorBuilder::OptionInterpreter::AggregateOptionFinder::FindExtension(google::protobuf::Message*, const std::string&) const':
./google/protobuf/descriptor.h:1152: error: `google::protobuf::internal::Mutex*google::protobuf::DescriptorPool::mutex_' is private
google/protobuf/descriptor.cc:4341: error: within this context
./google/protobuf/descriptor.h:1152: error: `google::protobuf::internal::Mutex*google::protobuf::DescriptorPool::mutex_' is private
google/protobuf/descriptor.cc:4342: error: within this context
make[2]: *** [descriptor.lo] Error 1
make[2]: Leaving directory `/home/liangry/download/protobuf-2.4.0a/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/liangry/download/protobuf-2.4.0a'
make: *** [all] Error 2

需打上以下补丁:



在protobuf-2.4.0a编译目录下,把上述内容保存为protobuf_gcc3.4.patch,然后输入以下命令即可。
$ patch -p0 < protobuf_gcc3.4.patch
patching file ./src/google/protobuf/descriptor.cc

参考文章:http://code.google.com/p/protobuf/source/detail?r=380#

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值