vcpkg安装:
地址:git clone https://github.com/microsoft/vcpkg.git
进入vcpkg目录:cd vcpkg
运行:.\bootstrap-vcpkg.bat
prtobuf安装:.\vcpkg install protobuf //须在vcpkg目录下运行
验证安装:vcpkg list可查看安装的protobuf版本
添加protobuf环境变量
D:\Program Files (x86)\vcpkg-master\vcpkg-master\installed\x64-windows\tools\protobuf
grpc安装:vcpkg install grpc
将vcpkg部署到vs studio: .\vcpkg integrate install
编译:
选择一个示例文件
E:\grpc\examples\cpp\helloworld;
创建编译目录
mkdir build;
cd build;
编译命令:cmake .. -G "Visual Studio 17 2022" -DCMAKE_TOOLCHAIN_FILE="D:/Program Files (x86)/vcpkg-master/vcpkg-master/scripts/buildsystems/vcpkg.cmake"
"D:/Program Files (x86)/vcpkg-master/vcpkg-master/scripts/buildsystems/vcpkg.cmake"为vcpkg.cmake目录;
Visual Studio 17 2022为vs studio版本;
8721

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



