找回密码
 立即注册
查看: 158|回复: 0

protobuf 版本问题

[复制链接]
发表于 2022-6-7 13:04 | 显示全部楼层 |阅读模式
This file was generated by an older version of protoc which is incompatible with your Protocol Buffer headers. Please  regenerate this file with a newer version of protoc.


which protoc 可以查看默认选用protoc的路径

protoc --version 可以查看当前protoc版本

删除旧版本
cd /usr/local/ (使用which protoc查询protobuf路径)
rm -rf protobuf
查看linux版本 cat /etc/redhat-release


protobuf下载地址:https://github.com/protocolbuffers/protobuf/releases
下载自己需要的版本
下载:wget https://github.com/protocolbuffers/protobuf/releases/download/v3.13.0/protobuf-all-3.13.0.tar.gz
解压:tar -zxvf protobuf-all-3.20.0.tar.gz
安装:cd protobuf-3.20.0
./configure --prefix=/usr/local/protobuf
make
make install
配置环境变量:
vi /etc/profile
加一行:export PKG_CONFIG_PATH=/usr/local/protobuf/lib/pkgconfig/
保存profile退出
检查版本是否生效:
source /etc/profile
protoc --version

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

×
懒得打字嘛,点击右侧快捷回复 【右侧内容,后台自定义】
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|Unity开发者联盟 ( 粤ICP备20003399号 )

GMT+8, 2024-5-20 00:04 , Processed in 0.125864 second(s), 26 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表