Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
321 views
in Technique[技术] by (71.8m points)

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

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是编译好的静态库。问题发生在,
引用静态库对应的头文件时,出现错误


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神解答

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...