社区微信群开通啦,扫一扫抢先加入社区官方微信群
社区微信群
点击逐个下载子模块,并复制到对应文件夹
Install Visual Studio 2015 or 2017 (Visual C++ compiler will be used).
Install Git.
Install CMake.
Install Active State Perl (choco install activeperl
) - required by boringssl
Install Go (choco install golang
) - required by boringssl
Install nasm and add it toPATH
(choco install nasm
) - required by boringssl
(Optional) Install Ninja (choco install ninja
)
mkdir .build
cd .build
cmake .. -G "Visual Studio 15 2017 Win64"
cmake --build . --config Debug
https://github.com/grpc/grpc/blob/master/BUILDING.md
protoc.exe -I=. --grpc_out=. --plugin=protoc-gen-grpc=.grpc_cpp_plugin.exe helloworld.proto
protoc.exe -I=. --cpp_out=. helloworld.proto
// 注:protoc.exe版本要与之对应,不然会报错
此步驟會生出下面檔案
helloworld.pb.h
helloworld.pb.cc
helloworld.grpc.pb.h
helloworld.grpc.pb.cc
选择Debug – x64构建配置
配置include目录、lib目录和lib导入
E:zdd-githubgrpc-master.buildthird_partyprotobufDebug;E:zdd-githubgrpc-master.buildDebug;E:zdd-githubgrpc-master.buildthird_partyzlibDebug;E:zdd-githubgrpc-master.buildthird_partycarescareslibDebug;E:zdd-githubgrpc-master.buildthird_partyboringsslDebug;E:zdd-githubgrpc-master.buildthird_partyboringsslsslDebug;E:Windows Kits10Lib10.0.18362.0umx64;E:zdd-githubgrpc-master.buildthird_partyboringsslcryptoDebug;E:zdd-githubgrpc-master.buildthird_partyabseil-cppabslbaseDebug;E:zdd-githubgrpc-master.buildthird_partyabseil-cppabslcontainerDebug;E:zdd-githubgrpc-master.buildthird_partyabseil-cppabslflagsDebug;E:zdd-githubgrpc-master.buildthird_partyabseil-cppabslhashDebug;E:zdd-githubgrpc-master.buildthird_partyabseil-cppabslnumericDebug;
E:zdd-githubgrpc-master.buildthird_partyabseil-cppabslrandomDebug;E:zdd-githubgrpc-master.buildthird_partyabseil-cppabslstringsDebug;E:zdd-githubgrpc-master.buildthird_partyabseil-cppabslsynchronizationDebug;E:zdd-githubgrpc-master.buildthird_partyabseil-cppabsltimeDebug;E:zdd-githubgrpc-master.buildthird_partyabseil-cppabsltypesDebug;
grpc++_unsecure.lib // 这个库必须放前面,不然解析不了ip
zlibd.lib;
ssl.lib
libprotobufd.lib
libprotobuf-lited.lib
libprotocd.lib
WS2_32.Lib
cares.lib;
upb.lib
boringssl_gtest.lib
grpcpp_channelz.lib
grpc_csharp_ext.lib
grpc++_reflection.lib
grpc++_error_details.lib
grpc_plugin_support.lib
grpc++_alts.lib
address_sorting.lib
grpc.lib
grpc++.lib;
grpc_unsecure.lib
zlibstaticd.lib
crypto.lib
gpr.lib
grpc_cronet.lib
absl_absl_base.lib
absl_absl_dynamic_annotations.lib
absl_absl_exponential_biased.lib
absl_absl_log_severity.lib
absl_absl_malloc_internal.lib
absl_absl_periodic_sampler.lib
absl_absl_raw_logging_internal.lib
absl_absl_scoped_set_env.lib
absl_absl_spinlock_wait.lib
absl_absl_throw_delegate.lib
absl_absl_hashtablez_sampler.lib
absl_absl_raw_hash_set.lib
absl_absl_flags.lib
absl_absl_flags_config.lib
absl_absl_flags_handle.lib
absl_absl_flags_internal.lib
absl_absl_flags_marshalling.lib
absl_absl_flags_program_name.lib
absl_absl_flags_parse.lib
absl_absl_flags_registry.lib
absl_absl_flags_usage.lib
absl_absl_flags_usage_internal.lib
absl_absl_city.lib
absl_absl_hash.lib
absl_absl_int128.lib
absl_absl_random_distributions.lib
absl_absl_random_internal_distribution_test_util.lib
absl_absl_random_internal_pool_urbg.lib
absl_absl_random_internal_randen.lib
absl_absl_random_internal_randen_hwaes.lib
absl_absl_random_internal_randen_hwaes_impl.lib
absl_absl_random_internal_randen_slow.lib
absl_absl_random_internal_seed_material.lib
absl_absl_random_seed_gen_exception.lib
absl_absl_random_seed_sequences.lib
absl_absl_str_format_internal.lib
absl_absl_strings.lib
absl_absl_strings_internal.lib
absl_absl_graphcycles_internal.lib
absl_absl_synchronization.lib
absl_absl_civil_time.lib
absl_absl_time.lib
absl_absl_time_zone.lib
absl_absl_bad_any_cast_impl.lib
absl_absl_bad_optional_access.lib
absl_absl_bad_variant_access.lib
配置预处理器定义:_WIN32_WINNT=0x600
指定zlib(d).dll路径:PATH=E:zdd-githubgrpc-master.buildthird_partyzlibDebug;
https://www.cnblogs.com/MakeView660/p/11511136.html
http://blog.alarmchang.com/?p=351
https://blog.csdn.net/qq_25005909/article/details/100540927
https://www.cnblogs.com/MakeView660/p/11511136.html
http://blog.alarmchang.com/?p=351
如果觉得我的文章对您有用,请随意打赏。你的支持将鼓励我继续创作!