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

Mac M1安装protobuf-2.5.0

[复制链接]
发表于 2022-3-4 15:49 | 显示全部楼层 |阅读模式
一、下载包 protobuf-2.5.0.tar.gz


https://github.com/protocolbuffers/protobuf/releases/tag/v2.5.0
二、解压包并修改文件platform_macros.h


./src/google/protobuf/stubs/platform_macros.h
增加下面这三行内容#elif defined(__arm64__)#define GOOGLE_PROTOBUF_ARCH_ARM 1#define GOOGLE_PROTOBUF_ARCH_64_BIT 1//定位到下面这两行#else#error Host architecture was not detected as supported by protobuf三、安装命令

./configure //默认安装到/usr/localmakemake checksudo make installprotoc --version //查看是否安装成功四、卸载

$ which protoc  /usr/local/bin/protoc$ sudo rm /usr/local/bin/protoc
懒得打字嘛,点击右侧快捷回复 【右侧内容,后台自定义】
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

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

GMT+8, 2025-5-10 01:10 , Processed in 0.682849 second(s), 25 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2025 Discuz! Team.

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