Using GRPC++ with Lite

419 views
Skip to first unread message

amarc...@gmail.com

unread,
May 30, 2018, 1:22:30 PM5/30/18
to grpc.io
The documentation suggests one can use option optimize_for = LITE_RUNTIME; in service definition proto file along with linking against libprotobuf-lite.lib to use the lite version.  I'm on Windows. I have successfully compiled with my generated files and linked to the libs without this option, but with it I'm getting some compiler errors:

Severity Code Description Project File Line Column Suppression State
Error C2027 use of undefined type 'grpc::SerializationTraits<R,void>' gateway-plugin-windows E:\Source\gateway-plugin-windows\src\main\cpp\thirdparty\grpc\grpcpp\impl\codegen\call.h 350 1
Error C3861 'Deserialize': identifier not found gateway-plugin-windows E:\Source\gateway-plugin-windows\src\main\cpp\thirdparty\grpc\grpcpp\impl\codegen\call.h 350 1
Error C2228 left of '.ok' must have class/struct/union gateway-plugin-windows E:\Source\gateway-plugin-windows\src\main\cpp\thirdparty\grpc\grpcpp\impl\codegen\call.h 351 1
Error C2027 use of undefined type 'grpc::SerializationTraits<R,void>' gateway-plugin-windows E:\Source\gateway-plugin-windows\src\main\cpp\thirdparty\grpc\grpcpp\impl\codegen\call.h 350 1
Error C3861 'Deserialize': identifier not found gateway-plugin-windows E:\Source\gateway-plugin-windows\src\main\cpp\thirdparty\grpc\grpcpp\impl\codegen\call.h 350 1
Error C2228 left of '.ok' must have class/struct/union gateway-plugin-windows E:\Source\gateway-plugin-windows\src\main\cpp\thirdparty\grpc\grpcpp\impl\codegen\call.h 351 1
Error C2027 use of undefined type 'grpc::SerializationTraits<R,void>' gateway-plugin-windows E:\Source\gateway-plugin-windows\src\main\cpp\thirdparty\grpc\grpcpp\impl\codegen\call.h 350 1
Error C3861 'Deserialize': identifier not found gateway-plugin-windows E:\Source\gateway-plugin-windows\src\main\cpp\thirdparty\grpc\grpcpp\impl\codegen\call.h 350 1
Error C2228 left of '.ok' must have class/struct/union gateway-plugin-windows E:\Source\gateway-plugin-windows\src\main\cpp\thirdparty\grpc\grpcpp\impl\codegen\call.h 351 1
Error C2027 use of undefined type 'grpc::SerializationTraits<R,void>' gateway-plugin-windows E:\Source\gateway-plugin-windows\src\main\cpp\thirdparty\grpc\grpcpp\impl\codegen\call.h 350 1
Error C3861 'Deserialize': identifier not found gateway-plugin-windows E:\Source\gateway-plugin-windows\src\main\cpp\thirdparty\grpc\grpcpp\impl\codegen\call.h 350 1
Error C2228 left of '.ok' must have class/struct/union gateway-plugin-windows E:\Source\gateway-plugin-windows\src\main\cpp\thirdparty\grpc\grpcpp\impl\codegen\call.h 351 1
Error C2027 use of undefined type 'grpc::SerializationTraits<R,void>' gateway-plugin-windows E:\Source\gateway-plugin-windows\src\main\cpp\thirdparty\grpc\grpcpp\impl\codegen\call.h 350 1
Error C3861 'Deserialize': identifier not found gateway-plugin-windows E:\Source\gateway-plugin-windows\src\main\cpp\thirdparty\grpc\grpcpp\impl\codegen\call.h 350 1
Error C2228 left of '.ok' must have class/struct/union gateway-plugin-windows E:\Source\gateway-plugin-windows\src\main\cpp\thirdparty\grpc\grpcpp\impl\codegen\call.h 351 1
Error C2027 use of undefined type 'grpc::SerializationTraits<R,void>' gateway-plugin-windows E:\Source\gateway-plugin-windows\src\main\cpp\thirdparty\grpc\grpcpp\impl\codegen\call.h 350 1
Error C3861 'Deserialize': identifier not found gateway-plugin-windows E:\Source\gateway-plugin-windows\src\main\cpp\thirdparty\grpc\grpcpp\impl\codegen\call.h 350 1
Error C2228 left of '.ok' must have class/struct/union gateway-plugin-windows E:\Source\gateway-plugin-windows\src\main\cpp\thirdparty\grpc\grpcpp\impl\codegen\call.h 351 1
Error C2027 use of undefined type 'grpc::SerializationTraits<RequestType,void>' gateway-plugin-windows E:\Source\gateway-plugin-windows\src\main\cpp\thirdparty\grpc\grpcpp\impl\codegen\method_handler_impl.h 63 1
Error C3861 'Deserialize': identifier not found gateway-plugin-windows E:\Source\gateway-plugin-windows\src\main\cpp\thirdparty\grpc\grpcpp\impl\codegen\method_handler_impl.h 63 1

I tried to find pre-processor macros that would control compilation with lite, but I'm at a loss.

Thanks,
Adam

araje...@gmail.com

unread,
Jun 4, 2018, 8:44:25 AM6/4/18
to grpc.io
I am also running into similar issue (https://github.com/grpc/grpc/issues/15604) when trying to use GRPC with protobuf-lite. I am currently using GRPC_USE_PROTO_LITE=true to build GRPC with protobuf-lite. Without proper documentation around the area, looking for help.
Reply all
Reply to author
Forward
0 new messages