protobuf編譯出錯的解決方案(iOS,OSX)


protobuf

最近使用protobuf,變編譯工具時遇上一點問題.現在附上解決方案

編譯過程

完全參照

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

編譯出錯

遇到如下錯誤

./google/protobuf/objectivec-descriptor.pb.h:17:2: error: This file was
generated by an older version of protoc which is
#error This file was generated by an older version of protoc which is
^
./google/protobuf/objectivec-descriptor.pb.h:18:2: error: incompatible with your
Protocol Buffer headers. Please
#error incompatible with your Protocol Buffer headers. Please
^
./google/protobuf/objectivec-descriptor.pb.h:19:2: error: regenerate this file
with a newer version of protoc.
#error regenerate this file with a newer version of proton.

解決方案

根據文檔中

ln -s /usr/local/Cellar/protobuf/2.6.1/bin/protoc /usr/local/bin

作者應該使用2.6.1編譯的,我將brew中的protobuf降級到了2.6.0(現在安裝是3.1.0).
結果可以順利編譯

另外附上降級指南http://sanwen8.cn/p/5a9lM4E.html


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM