WIN环境 下载与安装
下载
https://github.com/protocolbuffers/protobuf/releases
官方git地址,目前最新的是3.8版本;
我是c++环境,选择cpp下载包
protobuf-cpp-3.8.0.tar.gz
安装
解压后,打开protobuf-3.8.0\README.md 文件,里边明确指出了c++的安装参考文件:
Protocol Compiler Installation
The protocol compiler is written in C++. If you are using C++, please follow the C++ Installation Instructions to install protoc along with the C++ runtime.
链到如下文件:
protobuf-3.8.0\src\README.md
区分linux和win的安装方法;win又链到了另外一个文件:
To build from source using Microsoft Visual C++, see cmake/README.md.
protobuf-3.8.0\cmake\README.md
执行

本文介绍了在Windows上如何下载和安装protobuf 3.8.0版本,包括从GitHub获取cpp包,解压后根据README进行安装。安装完成后,重点讲解了如何使用protobuf的编译工具将.proto文件转化为C++的头文件和源文件,并利用官方API将protocol buffer对象转换为JSON格式。详细步骤包括调用protobuf.exe执行编译命令生成TMt.pb.h和TMt.pb.cc文件,并提供了相关的c++实例代码。
1万+

被折叠的 条评论
为什么被折叠?



