Reputation: 55
I'm trying to compile my .proto file, but protoc.exe is not generating the service class with its methods in cpp, protoc.exe is only compiling the messages. I'm compiling the .proto file with this command:
protoc -I=".\protos\" --cpp_out=".\protos\" ".\protos\mathtest.proto"
and here is the error I get, I can't access the Mathematics class that should have been generated, in my cpp code.
Is there anything else I'm missing here when compiling my .proto file? thank you!
Upvotes: 0
Views: 734
Reputation: 55
I found the answer, this is the command that got it working:
protoc -I .\protos\ --cpp_out=".\protos\" --grpc_out=".\protos\" --plugin=protoc-gen-grpc="C:\Program Files (x86)\grpc\bin\grpc_cpp_plugin.exe" .\protos\mathtest.proto
it happens that I was not generating the grpc code, I had to add these two more options:
--grpc_out=".\protos\" --plugin=protoc-gen-grpc="C:\Program Files (x86)\grpc\bin\grpc_cpp_plugin.exe"
Now it works and it generated the grpc stub properly in cpp!
Upvotes: 2