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
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.