1打开.gitmodules文件查看依赖的子模块,下载几个常见的
c-ares
protobuf
zlib
re2
boringssl
abseil-cpp(如果遇到cmake出现absl::就是这个问题)
2如果github下载速度慢,或者打开失败,除了网上教的修改hosts文件之外,也可以下面这个镜像地址 hub.fastgit.xyz/madler/zlib
3cmake如果报错,就看看具体缺哪个模块,再去下载
4在windows环境下测试成功的编译命令是
protoc --grpc_out=. --plugin=protoc-gen-grpc=grpc_cpp_plugin.exe helloworld.proto
protoc --cpp_out=. helloworld.proto
不是网上说的那些,那些命令可能是linux下使用的,调试了很久才调试出来的,太坑
5关于依赖的lib文件,不知道为什么所有编译出来的lib全部是分散开来的,依赖关系也复杂
这还是通过cmd命令行导出的所有lib文件名,添加到依赖项才编译通过的
cmd> DIR *.* /B >LIST.TXT
libprotobufd.lib
grpc.lib
grpc++.lib
gpr.lib
Ws2_32.lib
zlibd.lib
cares.lib
address_sorting.lib
absl_bad_any_cast_impl.lib
absl_bad_optional_access.lib
absl_bad_variant_access.lib
absl_base.lib
absl_city.lib
absl_civil_time.lib
absl_cord.lib
absl_cordz_functions.lib
absl_cordz_handle.lib
absl_cordz_info.lib
absl_cordz_sample_token.lib
absl_cord_internal.lib
absl_debugging_internal.lib
absl_demangle_internal.lib
absl_examine_stack.lib
absl_exponential_biased.lib
absl_failure_signal_handler.lib
absl_flags.lib
absl_flags_commandlineflag.lib
absl_flags_commandlineflag_internal.lib
absl_flags_config.lib
absl_flags_internal.lib
absl_flags_marshalling.lib
absl_flags_parse.lib
absl_flags_private_handle_accessor.lib
absl_flags_program_name.lib
absl_flags_reflection.lib
absl_flags_usage.lib
absl_flags_usage_internal.lib
absl_graphcycles_internal.lib
absl_hash.lib
absl_hashtablez_sampler.lib
absl_int128.lib
absl_leak_check.lib
absl_leak_check_disable.lib
absl_log_severity.lib
absl_low_level_hash.lib
absl_malloc_internal.lib
absl_periodic_sampler.lib
absl_random_distributions.lib
absl_random_internal_distribution_test_util.lib
absl_random_internal_platform.lib
absl_random_internal_pool_urbg.lib
absl_random_internal_randen.lib
absl_random_internal_randen_hwaes.lib
absl_random_internal_randen_hwaes_impl.lib
absl_random_internal_randen_slow.lib
absl_random_internal_seed_material.lib
absl_random_seed_gen_exception.lib
absl_random_seed_sequences.lib
absl_raw_hash_set.lib
absl_raw_logging_internal.lib
absl_scoped_set_env.lib
absl_spinlock_wait.lib
absl_stacktrace.lib
absl_status.lib
absl_statusor.lib
absl_strerror.lib
absl_strings.lib
absl_strings_internal.lib
absl_str_format_internal.lib
absl_symbolize.lib
absl_synchronization.lib
absl_throw_delegate.lib
absl_time.lib
absl_time_zone.lib
upb.lib
grpc++_alts.lib
grpc++_error_details.lib
grpc++_reflection.lib
grpc++_unsecure.lib
grpcpp_channelz.lib
grpc_csharp_ext.lib
grpc_plugin_support.lib
grpc_unsecure.lib
libprotobuf-lited.lib
libprotocd.lib