Mein Projekt wie die folgende Struktur:Fehler mit mehreren Bazel Dateien BUILD: "Target 'Bar' ist nicht sichtbar von Ziel 'foo'"
$ tree
.
├── bar
│ ├── bar.cpp
│ └── BUILD
├── BUILD
├── foo.cpp
└── WORKSPACE
Inhalt des ./BUILD
:
cc_binary(
name = "foo",
srcs = [ "foo.cpp" ],
deps = [ "//bar" ],
)
Inhalt von bar/BUILD
:
cc_library(
name = "bar",
srcs = ["bar.cpp"],
)
Wenn ich foo
bauen, erhalte ich die folgende err oder:
Target '//bar:bar' is not visible from target '//:foo'. Check the visibility declaration of the former target if you think the dependency is legitimate.
Was muss ich tun, damit die Abhängigkeit gelöst werden und foo
erfolgreich gebaut?