error: undefined reference to 'dlsym'

参考:https://stackoverflow.com/a/956698/12338026
bazel中,在linkopts中添加-ldl,如:

cc_binary(
    name = "hdfs_rw",
    srcs = ["hdfs_rw_test.cc"],
    linkopts = [
      "-lpthread",
      "-ldl",
    ],
    ...
)
posted @ 2020-04-15 11:49  Midnightcat  阅读(771)  评论(0编辑  收藏  举报