Here are the three files I am working with:
// city.proto
syntax = "proto3";
package city;
message City {
string cityName = 1;
string zipCode = 2;
string countryName = 3;
}
// street.proto
syntax = "proto3";
import "Exercise/city.proto";
package street;
message Street {
string cityName = 1;
city.City city = 2;
}
// building.proto
syntax = "proto3";
import "Exercise/street.proto";
package building;
message Building {
string buildingName = 1;
string buildingNumber = 2;
street.Street street = 3;
}
This is my current directory structure:
- PROTOCOLBUFFERS (folder on desktop)
- Exercise
- city.proto
- street.proto
- building.proto
This is the command I'm using to generate code from the proto files
protoc -I="."/Exercise --java_out=Exercise Exercise/*.proto
I am running this command with my terminal inside the PROTOCOLBUFFERS folder.
What am I doing wrong in the execution of this command? I am on windows. This is the error message I get and online search for it hasn't been useful.
building.proto:3:1: Import "Exercise/street.proto" was not found or had errors.
building.proto:10:5: "street.Street" is not defined.