4

I am trying to generate Google Assistant library in C++. I have compiled the embedded_assistant.proto file using protoc compiler and obtained the embedded_assistant.grpc.pb.h and embedded_assistant.grpc.pb.cc files for library. I created a client file ea_main.cc and included these files in it.

When i try to compile ea_main.cc using g++ compiler I get this error.

car@ubuntu:~/grpc/examples/cpp/embedded_assistant$ g++ -I./ ea_main.cc -o OUT_CPP_TEST -std=c++11
In file included from embedded_assistant.grpc.pb.h:22:0,           
                 from ea_main.cc:9:
embedded_assistant.pb.h:33:39: fatal error: google/api/annotations.pb.h: No such file or directory
compilation terminated.

In the embedded_assistant.proto file there is another proto file included in it as

import "google/api/annotations.proto";
import "google/rpc/status.proto";

It seems that the protoc didnt compiled or generated headers for these .proto files. When looked in google/api/ they ere not there.

So thats why the g++ compiler is giving errors for the missing annotations.pb.h file.

Why the protoc didnt compiled the proto included in embedded_assistant.proto ?How can I get these files?? Is something wrong?

1 Answers1

2

I got the solution i.e. include other required protos while compiling like:-

protoc --proto_path=protos --cpp_out=. protos/embedded_assistant.proto protos/google/api/annotations.proto protos/google/api/http.proto protos/google/rpc/status.proto