mardi 26 décembre 2017

Google Assistant SDK "cannot cast" compile error in api/auth.pb.cc

I tried to compile the new v1alpha2 of the grpc Google Assistant SDK.

For that i ran make (with cpp language output) inside the Google Assistant git repository, wich generated my *.pb.cc and *.ob.h files. Then i tried to compile the /google/api, /google/type *.pb.cc files into .o files, that i can link into my basic project. (the embedded_assistant.proto has two import statements: import "google/api/annotations.proto"; import "google/type/latlng.proto";). I also tried to compile it with /google/protobuf and /google/rpc.

It is automated by a makefile, and at this command i get the following error:

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

thanks for any help and wish you a nice holiday

Aucun commentaire:

Enregistrer un commentaire