diff --git a/cpp/README.md b/cpp/README.md index e9e9962a9bcceac8ac3e1952f4127c72283501d6..e0a09ff8b8790be58669515600069db210023e17 100644 --- a/cpp/README.md +++ b/cpp/README.md @@ -30,12 +30,13 @@ $ cd grpc-common/cpp/helloworld/ To generate the client and server side interfaces: ```sh -$ make helloworld.pb.cc +$ make helloworld.grpc.pb.cc helloworld.pb.cc ``` Which internally invokes the proto-compiler as: ```sh -$ protoc -I ../../protos/ --cpp_out=. --grpc_out=. --plugin=protoc-gen-grpc=grpc_cpp_plugin ../../protos/helloworld.proto +$ protoc -I ../../protos/ --grpc_out=. --plugin=protoc-gen-grpc=grpc_cpp_plugin ../../protos/helloworld.proto +$ protoc -I ../../protos/ --cpp_out=. ../../protos/helloworld.proto ``` ### Client and server implementations diff --git a/cpp/cpptutorial.md b/cpp/cpptutorial.md index ebad7b183b7ab62640eec29617e976dda98d0a32..9d49405118cb11296cb73e2c349cc1fd768237ef 100644 --- a/cpp/cpptutorial.md +++ b/cpp/cpptutorial.md @@ -94,18 +94,21 @@ Next we need to generate the gRPC client and server interfaces from our .proto s For simplicity, we've provided a [makefile](https://github.com/grpc/grpc-common/blob/master/cpp/route_guide/Makefile) that runs `protoc` for you with the appropriate plugin, input, and output (if you want to run this yourself, make sure you've installed protoc and followed the gRPC code [installation instructions](https://github.com/grpc/grpc/blob/master/INSTALL) first): ```shell -$ make route_guide.pb.cc +$ make route_guide.grpc.pb.cc route_guide.pb.cc ``` which actually runs: ```shell -$ protoc -I ../../protos --cpp_out=. --grpc_out=. --plugin=protoc-gen-grpc=`which grpc_cpp_plugin` ../../protos/route_guide.proto +$ protoc -I ../../protos --grpc_out=. --plugin=protoc-gen-grpc=`which grpc_cpp_plugin` ../../protos/route_guide.proto +$ protoc -I ../../protos --cpp_out=. ../../protos/route_guide.proto ``` Running this command generates the following files in your current directory: -- `route_guide.pb.h`, the header which declares your generated classes -- `route_guide.pb.cc`, which contains the implementation of your classes +- `route_guide.pb.h`, the header which declares your generated message classes +- `route_guide.pb.cc`, which contains the implementation of your message classes +- `route_guide.grpc.pb.h`, the header which declares your generated service classes +- `route_guide.grpc.pb.cc`, which contains the implementation of your service classes These contain: - All the protocol buffer code to populate, serialize, and retrieve our request and response message types diff --git a/cpp/helloworld/README.md b/cpp/helloworld/README.md index 16456a8245eb83a0214a16e64bd57cfa58485a6a..bc7df3f8c7a94d3c4530066785bffd4863707c60 100644 --- a/cpp/helloworld/README.md +++ b/cpp/helloworld/README.md @@ -78,12 +78,13 @@ defined in our `Greeting` service. To generate the client and server side interfaces: ```sh -$ make helloworld.pb.cc +$ make helloworld.grpc.pb.cc helloworld.pb.cc ``` Which internally invokes the proto-compiler as: ```sh -$protoc -I ../../protos/ --cpp_out=. --grpc_out=. --plugin=protoc-gen-grpc=grpc_cpp_plugin helloworld.proto +$ protoc -I ../../protos/ --grpc_out=. --plugin=protoc-gen-grpc=grpc_cpp_plugin ../../protos/helloworld.proto +$ protoc -I ../../protos/ --cpp_out=. ../../protos/helloworld.proto ``` ### Writing a client