2016-03-02 111 views
1

我正嘗試在gRPC中生成客戶端和服務器代碼。我已經從github安裝grpc目錄,並嘗試生成C++代碼。我安裝了proto編譯器3.0.0。無法使用gRPC中的proto 3.0緩衝區生成客戶端代碼

當我執行protoc我讓我下面的錯誤

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

任何想法,爲什麼我不能夠生成客戶端/服務器代碼

+0

你有'grpc_cpp_plugin'嗎?它是可執行的嗎? –

+0

我安裝了protoc 3.0.0,然後按照它說的運行MAKE的方式。但似乎它沒有創建cpp_plugin。 – Nitesh

回答

1

檢查/usr/local/bin。它應該與其他語言的插件一起存在。

/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*

如果你有其他的插件,但沒有CPP你可能忽略的東西,而安裝。

如果它有嘗試編譯(即--plugin=protoc-gen-grpc=/usr/local/bin/grpc_cpp_plugin

時,如果你有protobuf的檢查的多個版本,如果您使用protoc和插件從同一個指定的完整路徑。

相關問題