Installing Google Protocol Buffers on mac

前端 未结 14 1714
轮回少年
轮回少年 2020-12-12 10:24

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, bu

14条回答
  •  旧巷少年郎
    2020-12-12 11:04

    HomeBrew versions has been removed and formulaes have been emptied. Therefore, my advice is to install it manually following the following steps.

    For the time being you will need to build and install the Protocol Buffers toolset manually.

    1. Download source code: https://github.com/google/protobuf/releases/download/v2.4.1/protobuf-2.4.1.tar.gz

    2. tar xvfz protobuf-2.4.1.tar.gz

    3. cd protobuf-2.4.1

    4. Run ./configure

    5. Edit src/google/protobuf/message.cc, add #include at the top of the file

    6. Run make command from root of the folder, i.e. protobuf-2.4.1/

    7. Run sudo make install

    8. Run /usr/local/bin/protoc --version to check the version of protobuf compiler version The terminal output should be:

      Version: libprotoc 2.4.1

提交回复
热议问题