I have defined the following messages:

package myapp.proto.modules.diagnostics;

message DiagnosticsConfigMessage {
    optional bool watchdog_enabled = 1;
    optional uint32 watchdog_timeout = 2;

package myapp.proto;

import "src/myapp/proto/modules/diagnostics/DiagnosticsConfig.proto";

message ViewServerMessage {
    optional DiagnosticsConfig set_diagnostics_config = 8;

The first message is in src/myapp/proto and the second is in src/myapp/

When I try to compile Java classes with

 c:\users\myname\bin\protoc.exe --proto_path="C:\projects\MyApp.root
\MyApp" --java_out "C:\projects\MyApp.root\MyApp\build\generated-
sources\protobuf-java" "C:\projects\MyApp.root\MyApp\src\myapp\proto

I always get an error message:
src/myapp/proto/ViewServer.proto:20:14: "DiagnosticsConfigMessage" is
not defined. How is it possible to include a message defined in a
subdirectory? Defining all messages in the same namespace would work,
but it is quite ugly and I would like to avoid this if possible.

I am using protoc.exe 2.0.3 on Windows.

You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To post to this group, send email to protobuf@googlegroups.com
To unsubscribe from this group, send email to 
For more options, visit this group at 

Reply via email to