[Protobuf] Mac系統下安裝配置及簡單使用

Mac下Protobuf安裝

Protobuf源碼Github地址:

https://github.com/google/protobufjava

配置環境教程:

https://github.com/google/protobuf/blob/master/src/README.mdgit

注意問題:

1.Mac系統安裝配置工具。
    a.執行$ sudo xcode-select --install
    b.安裝port (https://www.macports.org)
    c.執行$ sudo /opt/local/bin/port install autoconf automake libtool    

2.命令執行
    解壓源碼文件後
    先執行
        $ ./autogen.sh
    再執行
        $ ./configure
        $ make
        $ make check
        $ sudo make install

編譯

定義.proto文件github

$ protoc -I=./ --java_out=./ ./xxx.proto
相關文章
相關標籤/搜索