在Mac上安装Google协议缓冲区 [英] Installing Google Protocol Buffers on mac
问题描述
我想使用Terminal命令行在Mac上安装旧版本的Google协议缓冲区(protobuf-2.4.1).我尝试使用brew install protobuf
,但是已经安装了最新版本2.5.0.是否可以从终端安装旧版本.
I would like to install the older version of Google Protocol Buffers (protobuf-2.4.1) on mac using Terminal command line. I tried with brew install protobuf
, but the latest version 2.5.0 has been installed. Is it possible to install the older version from terminal.
谢谢
推荐答案
在Mac上从源代码构建protobuf 2.4.1存在一些问题.有一个补丁也必须应用.所有这些都包含在自制的protobuf241公式中,所以我建议您使用它.
There are some issues with building protobuf 2.4.1 from source on a Mac. There is a patch that also has to be applied. All this is contained within the homebrew protobuf241 formula, so I would advise using it.
要安装2.4.1版的协议缓冲区,请在终端中输入以下内容:
To install protocol buffer version 2.4.1 type the following into a terminal:
brew tap homebrew/versions
brew install protobuf241
如果您已经尝试从源代码安装协议缓冲区版本,则可以在终端中键入以下内容,以使源代码被自制版本覆盖:
If you already have a protocol buffer version that you tried to install from source, you can type the following into a terminal to have the source code overwritten by the homebrew version:
brew link --force --overwrite protobuf241
通过键入以下内容检查您现在安装的版本是否正确:
Check that you now have the correct version installed by typing:
protoc --version
它应该显示2.4.1
It should display 2.4.1
这篇关于在Mac上安装Google协议缓冲区的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!