bazel 项目将其".so"文件存储在哪里?
Where does bazel project store its ".so" files?
我有一个非常简单的Bazel项目,该项目构建了图书馆和一个类似于下面的二进制文件:
cc_binary(
name = "hello-world",
srcs = ["hello-world.cc"],
deps = [":hello-greet"],
)
cc_library(
name = "hello-greet",
srcs = ["hello-greet.cc"],
hdrs = ["hello-greet.h"],
)
是的,它在我的Ubuntu框中工作:
# cat hello-greet.cc
#include<stdio.h>
void f(){
printf("f functionn");
}
# cat hello-world.cc
#include<stdio.h>
#include"hello-greet.h"
int main(){
f();
printf("%s n", "abc");
return 0;
}
" bazel build helly-world&amp; amp; amp; bazel run helly-world'将打印:
f function
abc
好吧,很好。但是我找不到我的libhello-greet在哪里,所以它存储在哪里?我在当前目录下找不到它。
非常感谢。
bazel将源树视为只读,并将其输出放在单独的输出目录中。找到此目录的官方方法是运行bazel info output_base
。但是,为了方便起见,巴泽尔还与该目录中的该目录中的 bazel-out
建立了符号链接。
在您的特定情况下,实际创建的hello-greet
可能没有共享库,可以在不创建中间共享对象的情况下构建二进制文件。bazel build //:hello-greet
应构建并显示hello-greet
共享对象的路径。
它在 bazel build
的输出中说的位置。通常在bazel-bin/...
中,遵循与源文件相同的目录结构。
相关文章:
- 谷歌测试中的期望值存储在哪里
- 常量参数存储在哪里 (C++)?
- 此递归函数的每次迭代的值存储在哪里?
- 如何告诉本机节点模块所需的dll存储在哪里?
- 模板参数在 C++ 中存储在哪里?
- C++ - thread_local变量存储在哪里?
- 返回值存储在哪里?
- glVertexAttribDivisor 存储在哪里 - VAO、VBO 或全局状态?
- 虚拟函数在哪里使用 vpointer to vtable 来解析方法调用,非虚拟方法存储在哪里以及如何解析它们?
- 为什么类型转换对象不会更改其地址?有关对象类型的信息存储在哪里?
- C++ - 函数中的局部指针变量具有什么类型的存储持续时间以及它们存储在哪里?
- bazel 项目将其".so"文件存储在哪里?
- 返回对象存储在哪里
- OpenSSL dll文件存储在哪里
- 如果我在我的函数中返回一个类,它存储在哪里
- 变量名称存储在哪里
- 引用变量存储在哪里
- 数组的指针,该数组的每个元素的内存空间信息存储在哪里
- 常量数据存储在哪里
- 编译时局部变量存储在哪里