翻了很多教程,下載了 PB 的源碼在自己的 mac 上編譯及安裝,記錄下新的
1. 首先是下載源碼了 https://github.com/google/protobuf/releases
雖然是 github,建議開代理,下載速度快一些。
2. tar -zxvf 解壓源碼后,需要編譯, 在新版的 PB 源碼中,是不包含 .configure 文件的,需要生成,此時先執行 ./autogen.sh 。
腳本說明如下:
# Run this script to generate the configure script and other files that will
# be included in the distribution. These files are not checked in because they
# are automatically generated.
3. 此時生成了 .configure 文件,可以開始編譯了
./configure --prefix=/Users/xielu/IdeaProjects/PB/
make && make install
Done
由於本人是用 golang 開發,還需要配置相關插件~ 此時待續
