0. grpc的github地址,里面也有教程:https://github.com/grpc/grpc.git
1. windows使用visual studio 2017编译需要以下几个环境:
a.安装git: https://git-scm.com/
b.安装golang: https://golang.org/dl/
c.安装cmake: https://cmake.org/download/ 加入path变量
d.安装active state perl: https://www.activestate.com/activeperl/
f.安装yasm: http://yasm.tortall.net/, 下载后改名为yasm.exe,并将yasm的路径加入到Path变量中。
总之,都要加入path变量!!
2. 切代码:
git clone -b v1.18.0 https://github.com/grpc/grpc.git
3. 进入grpc目录,下载依赖库:
git submodule update --init
下载完后third_party目录:
4. 在grpc目录使用cmd(或者使用vs2017的命令行)执行生成vs2017 32位工程:
md .build && cd .build
cmake .. -G "Visual Studio 15 2017"
此时在.build目录会生成grpc.sln工程:
5.使用vs2017打开,右键ALL_BUILD编译:
右键INSALL编译:(其实是安装,文件会保存到C:\Program Files (x86)/grpc, 可能会没权限,使用管理员方式打开vs2017,之后再重复上面的动作安装即可)
6. 查看.build下Debug/Release目录下生成的lib和插件:
以及C:\Program Files (x86)/grpc目录下的文件:
OK,到这里已经编译完成了。
下一节,编译并简单使用examples里面的helloworld示例。
https://blog.csdn.net/shan165310175/article/details/86619128