2

I am trying to generate client and server code in gRPC. I have installed grpc directory from github and trying to generate C++ code. I installed proto compiler 3.0.0.

When I am executing protoc i am getting below error

$ protoc -I ../../protos/ --grpc_out=. --plugin=protoc-gen-grpc=grpc_cpp_plugin ../../protos/helloworld.proto grpc_cpp_plugin: program not found or is not executable --grpc_out: protoc-gen-grpc: Plugin failed with status code 1. 

Any idea why I am not able to generate client/server code

2
  • Do you have grpc_cpp_plugin? Is it executable? Commented Mar 2, 2016 at 7:29
  • I installed protoc 3.0.0 and then followed the way it was saying to run MAKE. But seems like it has not created cpp_plugin. Commented Mar 2, 2016 at 7:38

1 Answer 1

3

Check your /usr/local/bin. It should be there along with plugins for other languages.

/usr/local/bin > ll total 71144 -rwxr-xr-x 1 root root 12721867 Oct 23 10:44 grpc_cpp_plugin* -rwxr-xr-x 1 root root 14509678 Oct 23 10:44 grpc_csharp_plugin* -rwxr-xr-x 1 root root 13339870 Oct 23 10:44 grpc_objective_c_plugin* -rwxr-xr-x 1 root root 12569518 Oct 23 10:44 grpc_python_plugin* -rwxr-xr-x 1 root root 12393363 Oct 23 10:44 grpc_ruby_plugin*

If you do have other plugins but not cpp you probably overlooked something while installing.

If it's there try to specify full path when compiling (i.e. --plugin=protoc-gen-grpc=/usr/local/bin/grpc_cpp_plugin)

If you have multiple version of protobuf check if you use protoc and plugin from the same one.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.