bazel如何编译.a静态库文件?

TenXm04a
  • 1
新手上路,请多包涵
cc_library(
name = 'jsf_api',
hdrs = glob([
                 "**/*.hh",
                  "**/*.h",
               ]),
      srcs = [
                   "lib/libjsf_provider.a",
               ],
      visibility = ["//visibility:public"],
  )

cc_library(
name = "tensorflow_model_server_main_lib",
srcs = [
     "main.cc",                                                                      
 ],
 hdrs = [
     "version.h",
 ],
 linkstamp = "version.cc",
 visibility = [
     ":tensorflow_model_server_custom_op_clients",
     "//tensorflow_serving:internal",
 ],
 deps = [
     ":server_lib",
    "@org_tensorflow//tensorflow/c:c_api",
     "@org_tensorflow//tensorflow/core:lib",
     "@org_tensorflow//tensorflow/core/platform/cloud:gcs_file_system",
     "@org_tensorflow//tensorflow/core/platform/hadoop:hadoop_file_system",
    "@org_tensorflow//tensorflow/core/platform/s3:s3_file_system",
     "//ads_lib/ump:ump",
     "//ads_lib/jsf_api:jsf_api",                                                    
],)
在main.cc函数中,调用库

#include "jsf_api/jsf_mgr.h"
#include "jsf_api/jsf_option.h"
错误发生在这里,无法找到文件。 
 

目录结构如下
.
|-- BUILD
|-- BUILD.blade
|-- OWNER
|-- README.md
|-- jsf_mgr.cc
|-- jsf_mgr.h
|-- jsf_mgr_inl.cc
|-- jsf_option.h
|-- lib
| |-- libjsf_provider.a
| `-- libjsf_provider_fpic.a

其中,libjsf_provider.a是编译好的静态库。问题发生在,
引用静态库对应的头文件时,出现错误

回复
阅读 308
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
你知道吗?

宣传栏