Closed HuangLianghong closed 2 years ago
I have tried to specify 'hiredis' and 'redis++' include path as below:
cc_library(
name = "memory_store",
srcs = glob([
"memory_store/*.cpp",
]),
hdrs = glob([
"memory_store/*.hpp",
]),
deps = [
"@com_github_google_glog//:glog",
],
linkopts = [
"-l:/home/liangzhigao/huanglianghong/redis-plus-plus-lib/lib/libredis++.a",
"-l:/home/liangzhigao/huanglianghong/hiredis-lib/lib/libhiredis.a -pthread",
],
copts = [
"-I/home/liangzhigao/huanglianghong/redis-plus-plus-lib/include",
"-I/home/liangzhigao/huanglianghong/hiredis-lib/include/",
],
)
but another error occur:
ERROR: /home/liangzhigao/huanglianghong/reas/cpp/BUILD:15:11: Compiling cpp/memory_store/memory_store.cpp failed: The include path '/home/liangzhigao/huanglianghong/redis-plus-plus-lib/include' references a path outside of the execution root.
Target //cpp:reas failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 0.389s, Critical Path: 0.11s
INFO: 4 processes: 4 internal.
FAILED: Build did NOT complete successfully
FAILED: Build did NOT complete successfully
This looks like a Bazel question. Sorry but I'm not familiar with Bazel. You might need to seek help from a Bazel expert.
Regards
I install redis++ and hiredis at non-default location(e.g. /home/liangzhigao/huanglianghong/redis-plus-plus-lib/), and I want to link the static library in bazel, so I add linkopts as below:
But while runing the Build file, error occur:
How can I solve this problem?