Installing Google Protocol Buffers on mac

informatiker picture informatiker · Feb 14, 2014 · Viewed 145.2k times · Source

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.

Thanks

Answer

John Gilmore picture John Gilmore · May 20, 2014

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.

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

It should display 2.4.1