layout: post
title: “Windows下protobuf3安装小记”
subtitle: “在坑里打滚的经历。。。”
date: “2016-07-11”
author: “cj”
tags:
proto3
protobuf
windows
c++
一开始搞的是2,可惜我要用的gRPC只能用proto3.
proto2:
在vsprojects文件夹内打开sln即可。
使用visual studio 2015,需在config.h添加
#define _SILENCE_STDEXT_HASH_DEPRECATION_WARNINGS
#define _SCL_SECURE_NO_WARNINGS
proto3:
proto3还没有正式支持windows下编译,下载了编译好的protoc3.0.0-beta-3-win32.zip。
编译示例addressbook.proto:
protoc --cpp_out=. adressbook.proto
成功生成了addressbook.pb.h