grpc Google Assistant SDKの新しいv1alpha2をコンパイルしようとしました。Google Assistant SDK「api/auth.pb.cc」でコンパイルエラーをキャストできません
Google Assistant gitリポジトリ内でmake(cpp言語出力)を実行しました。私の*.pb.cc
と*.ob.h
というファイルが生成されました。それから私は/google/api
、/google/type
*.pb.cc
ファイルを.o
ファイルにコンパイルしようとしました。それは私の基本プロジェクトにリンクすることができます。 (embedded_assistant.proto
には2つのインポートステートメントがあります:import "google/api/annotations.proto"; import "google/type/latlng.proto";
)。
また、/google/protobuf
と/google/rpc
でコンパイルしようとしました。
それはmakefile
によって自動化され、このコマンドでは、私は次のエラーを取得されています。任意の助け
make generated command:
g++ -c -I/usr/local/include -pthread -I./googleapis/gens -I./grpc -std=c++11 googleapis/gens/google/api/auth.pb.cc -o googleapis/gens/google/api/auth.pb.o
output:
googleapis/gens/google/api/auth.pb.cc:552:23: error: cannot cast '::google::protobuf::RepeatedPtrField< ::google::api::AuthenticationRule>' to its private base class
'google::protobuf::internal::RepeatedPtrFieldBase'
rules_.InternalSwap(&other->rules_);
^
/usr/local/include/google/protobuf/repeated_field.h:776:41: note: declared private here
class RepeatedPtrField PROTOBUF_FINAL : private internal::RepeatedPtrFieldBase {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
googleapis/gens/google/api/auth.pb.cc:553:27: error: cannot cast '::google::protobuf::RepeatedPtrField< ::google::api::AuthProvider>' to its private base class
'google::protobuf::internal::RepeatedPtrFieldBase'
providers_.InternalSwap(&other->providers_);
^
/usr/local/include/google/protobuf/repeated_field.h:776:41: note: declared private here
class RepeatedPtrField PROTOBUF_FINAL : private internal::RepeatedPtrFieldBase {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
googleapis/gens/google/api/auth.pb.cc:936:30: error: cannot cast '::google::protobuf::RepeatedPtrField< ::google::api::AuthRequirement>' to its private base class
'google::protobuf::internal::RepeatedPtrFieldBase'
requirements_.InternalSwap(&other->requirements_);
^
/usr/local/include/google/protobuf/repeated_field.h:776:41: note: declared private here
class RepeatedPtrField PROTOBUF_FINAL : private internal::RepeatedPtrFieldBase {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3 errors generated.
make: *** [googleapis/gens/google/api/auth.pb.o] Error 1
感謝をし、completly新しい、今それ
私はこれを打つ。 gRPCとprotobufsのバージョンミックスによって発生します。ビルドしているgRPCブランチが参照しているものと同じバージョンのprotobufsを必ず使用してください。 – fionbio