我已经使用所有依赖项(Protobuf,a-arec等)编译了gRPC 1.23.0。
将我的.proto
文件转换为*.grpc.pb.*
和*.pb.*
文件之后,我将其添加到VS项目中并成功地将其编译为.exe
文件。
但是在我将Configuration type
属性切换为Dynamic library
或Static library
(我确实确实需要Static library
)之后,它进行了编译而没有错误,但是在{{1 }}我看到这样的> 2000个链接警告:
Build output
最后链接以错误结束:
1>grpc++_unsecure.lib(pb_encode.obj) : warning LNK4006: _pb_encode_submessage already defined in grpc++.lib(pb_encode.obj); second definition ignored
1>grpc++_unsecure.lib(pb_encode.obj) : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
1>grpc++_unsecure.lib(codegen_init.obj) : warning LNK4006: "class grpc::CoreCodegenInterface * grpc::g_core_codegen_interface" (?g_core_codegen_interface@grpc@@3PAVCoreCodegenInterface@1@A) already defined in grpc++.lib(codegen_init.obj); second definition ignored
1>grpc++_unsecure.lib(codegen_init.obj) : warning LNK4006: "class grpc::GrpcLibraryInterface * grpc::g_glip" (?g_glip@grpc@@3PAVGrpcLibraryInterface@1@A) already defined in grpc++.lib(codegen_init.obj); second definition ignored
1>grpc++_unsecure.lib(codegen_init.obj) : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
1>grpc_unsecure.lib(init.obj) : warning LNK4006: _grpc_register_plugin already defined in grpc.lib(init.obj); second definition ignored
1>grpc_unsecure.lib(init.obj) : warning LNK4006: _grpc_init already defined in grpc.lib(init.obj); second definition ignored
1>grpc_unsecure.lib(init.obj) : warning LNK4006: _grpc_shutdown already defined in grpc.lib(init.obj); second definition ignored
1>grpc_unsecure.lib(init.obj) : warning LNK4006: _grpc_is_initialized already defined in grpc.lib(init.obj); second definition ignored
仅对于1>libprotobufd.lib(version.res) : fatal error LNK1241: resource file libprotocd.lib(version.res) already specified
配置,会出现此错误。在Debug
上,它可以成功链接,但也可以链接警告。
我应该怎么解决?