Based on a [HelloWorld][1] from grpc, I have created a project with my own proto file. This proto file also imports another proto file in the same directory:
MainProto.proto:
syntax = "proto3";
package MyProject;
option csharp_namespace = "MyProject";
option optimize_for = SPEED;
option cc_enable_arenas = true;
import "google/protobuf/empty.proto";
import "google/protobuf/timestamp.proto";
import "google/protobuf/wrappers.proto";
import "CommonUtils.proto";
....
Followed by a bunch of enums, messages and services, some of which use the enums/messages from CommonUtils.proto.
In the CMakeLists.txt file, I generate the .cc and .hh based on the MainProto.proto file. However, this does not seem to generate the necessary files for CommonUtils.proto, which are then detected as errors in MainProto.pb.h and the other generated header files.
My question is:
1. How do I modify my CMakeLists or Makefile to also build the headers and cc files for CommonUtils?
2. How do I link the generated files together to avoid "unresolved external symbol" errors?
I have tried replacing the proto file in my CMakeList.txt file (the lines # Proto file and # Generating source) with the CommonUtils.proto, and then replacing it and running with the original MainProto.proto, but I get a bunch of unresolved external symbol errors in the generated MainProto.pb.h for all the fields that should be imported from CommonUtils.proto.