grpc C++笔记

2020-01-20  本文已影响0人  我是电饭煲

编译grpc C++教程

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 to PATH (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

搭建C++ rpc example(Windows)

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
E:\zdd-github\grpc-master\.build\third_party\protobuf\Debug;E:\zdd-github\grpc-master\.build\Debug;E:\zdd-github\grpc-master\.build\third_party\zlib\Debug;E:\zdd-github\grpc-master\.build\third_party\cares\cares\lib\Debug;E:\zdd-github\grpc-master\.build\third_party\boringssl\Debug;E:\zdd-github\grpc-master\.build\third_party\boringssl\ssl\Debug;E:\Windows Kits\10\Lib\10.0.18362.0\um\x64;E:\zdd-github\grpc-master\.build\third_party\boringssl\crypto\Debug;E:\zdd-github\grpc-master\.build\third_party\abseil-cpp\absl\base\Debug;E:\zdd-github\grpc-master\.build\third_party\abseil-cpp\absl\container\Debug;E:\zdd-github\grpc-master\.build\third_party\abseil-cpp\absl\flags\Debug;E:\zdd-github\grpc-master\.build\third_party\abseil-cpp\absl\hash\Debug;E:\zdd-github\grpc-master\.build\third_party\abseil-cpp\absl\numeric\Debug;
E:\zdd-github\grpc-master\.build\third_party\abseil-cpp\absl\random\Debug;E:\zdd-github\grpc-master\.build\third_party\abseil-cpp\absl\strings\Debug;E:\zdd-github\grpc-master\.build\third_party\abseil-cpp\absl\synchronization\Debug;E:\zdd-github\grpc-master\.build\third_party\abseil-cpp\absl\time\Debug;E:\zdd-github\grpc-master\.build\third_party\abseil-cpp\absl\types\Debug;
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

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

上一篇下一篇

猜你喜欢

热点阅读