用如何查看protobuf版本本错误问题,怎么解决

最近使用protobuf,变编译工具时遇上一点问题.现在附上解决方案
https://github.com/alexeyxo/protobuf-objc
遇到如下错误
./google/protobuf/objectivec-descriptor.pb.h:17:2: error: This file was
generated by an older version of protoc which is
#error This file was generated by an older version of protoc which is
./google/protobuf/objectivec-descriptor.pb.h:18:2: error: incompatible with your
Protocol Buffer headers. Please
#error incompatible with your Protocol Buffer headers. Please
./google/protobuf/objectivec-descriptor.pb.h:19:2: error: regenerate this file
with a newer version of protoc.
#error regenerate this file with a newer version of proton.
根据文档中
ln -s /usr/local/Cellar/protobuf/2.6.1/bin/protoc /usr/local/bin
作者应该使用2.6.1编译的,我将brew中的protobuf降级到了2.6.0(现在安装是3.1.0).
结果可以顺利编译
另外附上降级指南http://sanwen8.cn/p/5a9lM4E.html
阅读(...) 评论()用protobuf版本错误问题,怎么解决_百度知道
用protobuf版本错误问题,怎么解决
我有更好的答案
我刚遇到这个问题,但我没用anaconda.我首先 Pip show protobuf, 看看什么版本,发现安装的是3.3.0,然后我pip uninstall protobuf,然后再从网上下一个2.6.1的protobuf 装上就好了
为您推荐:
其他类似问题
换一换
回答问题,赢新手礼包
个人、企业类
违法有害信息,请在下方选择后提交
色情、暴力
我们会通过消息、邮箱等方式尽快将举报结果通知您。[求助]protobuf文件编译错误,求解决方案
我定义了一个结构 &&&message Person { && required string name = 1; && required int32 age = 2; && optional string email = 3; &&&}把person.pb.h、person.pb.cc放到我的VS2008的代码中,编译
person.pb.cc 是OK的,但Link过程出现如下错误,该怎么解决:1&person.pb.obj : error LNK2019: unresolved external symbol "void __cdecl google::protobuf::internal::AssignDescriptors(class std::basic_string&char,struct std::char_traits&char&,class std::allocator&char& & const &,struct google::protobuf::internal::MigrationSchema const *,class google::protobuf::Message const * const *,unsigned int const *,class google::protobuf::MessageFactory *,struct google::protobuf::Metadata *,class google::protobuf::EnumDescriptor const * *,class google::protobuf::ServiceDescriptor const * *)" (?AssignDescriptors@internal@protobuf@google@@YAXABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@PBUMigrationSchema@123@PBQBVMessage@23@PBIPAVMessageFactory@23@PAUMetadata@23@PAPBVEnumDescriptor@23@PAPBVServiceDescriptor@23@@Z) referenced in function "void __cdecl tutorial::protobuf_person_2eproto::`anonymous namespace'::protobuf_AssignDescriptors(void)" (?protobuf_AssignDescriptors@?A0xa87d9ff2@protobuf_person_2eproto@tutorial@@YAXXZ)1&person.pb.obj : error LNK2019: unresolved external symbol "public: virtual __thiscall google::protobuf::internal::FunctionClosure0::~FunctionClosure0(void)" (??1FunctionClosure0@internal@protobuf@google@@UAE@XZ) referenced in function "void __cdecl google::protobuf::GoogleOnceInit(int *,void (__cdecl*)(void))" (?GoogleOnceInit@protobuf@google@@YAXPAHP6AXXZ@Z)1&person.pb.obj : error LNK2019: unresolved external symbol "void __cdecl google::protobuf::GoogleOnceInitImpl(int *,class google::protobuf::Closure *)" (?GoogleOnceInitImpl@protobuf@google@@YAXPAHPAVClosure@12@@Z) referenced in function "void __cdecl google::protobuf::GoogleOnceInit(int *,void (__cdecl*)(void))" (?GoogleOnceInit@protobuf@google@@YAXPAHP6AXXZ@Z)1&person.pb.obj : error LNK2019: unresolved external symbol "public: virtual __thiscall google::protobuf::Closure::~Closure(void)" (??1Closure@protobuf@google@@UAE@XZ) referenced in function "public: virtual void * __thiscall google::protobuf::Closure::`scalar deleting destructor'(unsigned int)" (??_GClosure@protobuf@google@@UAEPAXI@Z)
支付方式:
最新回复 (2)
是不是protobuf的.lib文件没加进去
跟编译选项应该有关,结贴。
1.请先关注公众号。
2.点击菜单"更多"。
3.选择获取下载码。他的最新文章
他的热门文章
您举报文章:
举报原因:
原文地址:
原因补充:
(最多只允许输入30个字)Centos6.4下安装protobuf-c问题及解决办法
Centos6.4下安装protobuf-c问题及解决办法
  protobuf是Google提供的结构持久化工具,类型XML,但要比XML更加灵活,效率要高。protobuf当初支持C++、JAVA和Python,后来有了支持C语言的Protobuf-c。
  protobuf是Google提供的结构持久化工具,类型XML,但要比XML更加灵活,效率要高。protobuf当初支持C++、JAVA和Python,后来有了支持C语言的Protobuf-c。关于prorobuf可以参考:和。
2、安装protobuf-c问题
  今天从google官方网站上面下载了protobuf-c,解压进行安装,在执行./configure时候出现错误:
错误提示:protobuf headers are required.
解决办法:安装完整的protobuf,安装在默认的路径。下载完整的protobuf安装,下载地址:。网上所示的解决办法如下所示:
安装完protobuf后,再在protobuf-c目录下执行./configure执行成功,但是make时候出现错误:
protoc: error while loading shared libraries: libprotoc.so.8: cannot open shared错误原因:protobuf的默认安装路径是/usr/local/lib,而/usr/local/lib 不在Linux体系默认的 LD_LIBRARY_PATH 里,所以就找不到该lib解决方法:创建文件 /etc/ld.so.conf.d/libprotobuf.conf 包含内容:
保持退出,然后执行. 输入命令 sudo ldconfig。ldconfig命令参考:
make成功,make install
测试程序:写一个proto,文件命名为:dmessage.proto ,内容如下:
用protoc-c编译生成.h和.c文件如下:protoc-c --c_out=.
dmessage.proto
用云栖社区APP,舒服~
【云栖快讯】直播推荐——现在报名3月12日编程语言系列讲座,与行业资深专家一起学习Python、C++、JavaScript、Java!还可在活动页面领取红包,百分百中奖哦!&&
MySQL 是全球最受欢迎的开源数据库,阿里云MySQL版 通过深度的内核优化和独享实例提供...
深度挖掘企业与企业、企业与人物的关系,通过多位交叉分析及智能算法,构建基于企业全息画像和企业...
阿里云移动APP解决方案,助力开发者轻松应对移动app中随时可能出现的用户数量的爆发式增长、...
为您提供简单高效、处理能力可弹性伸缩的计算服务,帮助您快速构建更稳定、安全的应用,提升运维效...}

我要回帖

更多关于 如何查看protobuf版本 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信