mac编译安装protobuf

1、在安装protobuf之前需要先安装git、make、automake等工具,安装方法请参考:https://blog.csdn.net/sunxiaoju/article/details/85217424

2、在安装好protobuf后需要安装protobuf,依赖库,首先使用:git clone https://github.com/protocolbuffers/protobuf克隆,如下图所示:

3、然后进入到protobuf目录执行./autogen.sh,此时会出现

configure.ac:104: error: possibly undefined macro: AC_PROG_LIBTOOL

If this token and others are legitimate, please use m4_pattern_allow.错误,如下图所示:

4、需要安装libtool,使用brew install libtool安装,如下图所示:

5、再次执行./autogen.sh即可,如下图所示:

6、然后执行:./configure,如下图所示:

7、然后执行make命令,如下图所示:

8、然后执行make install进行安装,如下图所示:

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
要在Mac安装Protobuf,有两种方式可以选择。 方式一:通过brew方式安装Protobuf 1. 首先,确保已经安装了brew。如果没有安装,可以通过以下命令安装brew: /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" 2. 安装Protobuf最新版本,可以使用以下命令: brew install protobuf 3. 如果需要安装指定版本的Protobuf,可以先查看brew当前维护的版本: brew search protobuf 然后选择需要的版本进行安装。 方式二:通过源码编译安装Protobuf 1. 进入到Protobuf源码目录下,可以使用以下命令: cd protobuf-all-3.12.3 2. 检测安装环境是否满足条件,并生成Makefile: ./configure --prefix=/usr/local/protobuf 3. 编译安装Protobuf: make && make install 无论是通过brew方式还是源码编译方式安装Protobuf安装路径都是/usr/local/protobuf。如果需要卸载Protobuf,可以使用以下命令: brew uninstall protobuf 请注意,以上是在Mac系统上安装Protobuf的方法。 #### 引用[.reference_title] - *1* *2* *3* [Protobuf 介绍与实战1:Mac环境下安装Protobuf(两种方式安装)](https://blog.csdn.net/u011582922/article/details/122033780)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item] [ .reference_list ]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值