protobuf 介绍
Protocol Buffers (a.k.a., protobuf) are Google’s language-neutral, platform-neutral, extensible mechanism for serializing structured data.
翻译:
Protobuf 是Google开放的一个跨语言,跨平台,可扩展的序列化结构数据.
结论:
跨语言: 可以在多个语言(c++, java, Python 下使用)
跨平台: 可以在Window/ Linux 下使用
序列化: 可将对象数据存储起来,长久使用.
结构化数据: 应该不可以用于文本等非结构化数据
需求
- Protobuf源代码: https://github.com/google/protobuf/branches/active
- CMake
- VS2012
编译过程
- 使用Cmake 执行源代码下Cmakelist, 生成VS2012工程 (注意自己选择的X86还是X64的)
- 打开工程文件 (注意生成的是release 还是Debug )
- 如果 All_build失败,则单独编译需要的库
- 编译libprotobuf -> 生成 libprotobuf.lib
- 编译libprotobuf-lite -> 生成 libprotobuf-lite.lib