我不知何故在Windows10上错误地配置了Bazel,所以它生成的可执行文件没有使用.exe扩展名。它不会生成像hello.exe这样的二进制文件,而是会生成一个名为hello的二进制文件。
例如,我有一个目标
# examples/BUILD
cc_binary(
name = "gflags_example",
srcs = ["gflags_example.cpp"],
deps = [
"@com_github_gflags_gflags//:gflags"
]
)然后我运行bazel build -s examples:gflags_example,发现它像这样调用link.exe
C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.24.28314/bin/HostX64/x64/link.exe @bazel-out/x64_windows-fastbuild/bin/examples/gflags_example-2.params 在glfags_example-2.params文件中,它指定了/OUT:bazel-out/x64_windows-dbg/bin/examples/gflags_example,其中我猜它应该是/OUT:bazel-out/x64_windows-dbg/bin/examples/gflags_example.exe
我怎样才能影响Bazel生成正确的gflags_example-2.params文件,这样我就可以找回我的.exe扩展名了?
发布于 2020-04-03 15:46:50
我觉得这很正常。它以前起作用了吗?
您只需要构建bazel build //examples:gflags_example.exe
https://stackoverflow.com/questions/60999118
复制相似问题