title: Including Protobufs with Bazel
body: <p>I have the following <code>BUILD</code> file:</p>
  
  <pre><code>load("@com_google_protobuf//:protobuf.bzl", "cc_proto_library")
  
  ### Protos ###
  
  cc_proto_library(
      name = "homework_cc_proto",
      protoc = "@com_google_protobuf//:protoc",
      default_runtime = "@com_google_protobuf//:protobuf",
  )
  
  proto_library(
      name = "homework_proto",
      srcs = [
          "protos/complexity.proto",
          "protos/example.proto",
          "protos/problem.proto",
          "protos/solution.proto",
      ],
  )
  
  ### End Protos ###
  
  ### Binaries ###
  
  cc_binary(
      name = "main",
      srcs = ["main.cc"],
      deps = [":homework_cc_proto"],
  )
  </code></pre>
  
  <p>and <code>main.cc</code>:</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include "example.pb.h"
  
  int main() {
    std::cout &lt;&lt; "Hello!" &lt;&lt; std::endl;
  }
  </code></pre>
  
  <p>If I invoke <code>bazel build :homework_cc_proto</code>, the build is successful. However, when I run <code>bazel build :main</code> I get an error saying that <code>example.pb.h</code> cannot be found. How can I import my built protobufs?</p>