Mac 上的 Protobuf 2.6.0 响应错误:tar:无法识别的存档格式

Protobuf 2.6.0 response error on Mac: tar: Unrecognized archive format

无法安装Protobuf 2.6.0,详情如下:

ryous-MacBook-Pro:~ raniys$ protoc --version
libprotoc 2.6.0
ryous-MacBook-Pro:~ raniys$ cd /Users/raniys/Downloads/protobuf-2.6.0 
ryous-MacBook-Pro:protobuf-2.6.0 raniys$ ./autogen.sh 
Google Test not present.  Fetching gtest-1.5.0 from the web...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  1586  100  1586    0     0   2948      0 --:--:-- --:--:-- --:--:--  2953
tar: Unrecognized archive format
tar: Error exit delayed from previous errors.

brew 找不到 protobuf 2.6.1:

ryous-MacBook-Pro:~ raniys$ brew install protobuf261
Error: No available formula with the name "protobuf261" 
==> Searching for similarly named formulae...
Error: No similarly named formulae found.
==> Searching taps...
Error: No formulae found in taps.

macOS 版本:10.12.1 自制软件 1.0.8

感谢您的帮助。

2.6.0 源 tarball 太旧了,试图获取不再存在的 link。我建议升级到较新的版本,例如 3.1,除非您有特殊原因坚持使用 2.6.0。

我已经解决了这个问题,下面是从 link:

复制过来的
  1. run command 'brew install protobuf' to install the protobuf, the version of protobuf should be 3.1.0;
  2. download the protobuf-2.6.1:
    https://github.com/google/protobuf/releases/download/v2.6.1/protobuf- 2.6.1.tar.bz2
  3. Uncompress and cd to the protobuf-2.6.1 folder:
./autogen.sh

./configure

make

make install

*4. download the protobuf-objc and build(only for oc):

git clone https://github.com/alexeyxo/protobuf-objc.git

cd protobuf-objc

./scripts/build.sh
  1. Try command 'protoc --version' in the terminal, if the protobuf version is showing, means all finished, else please re-do the step 3 and 4.