我可以使用以下命令安装glog:
brew install glog
然后我可以使用g++成功地编译和使用它:
g++ src/main/main_logger.cc -std=c++17 -lglog
如何使用bazel执行此操作
我得到了这个错误:
fatal error: 'glog/logging.h' file not found
#include <glog/logging.h>
^~~~~~~~~~~~~~~~
1 error generated.发布于 2020-10-15 19:22:34
已经有一个文档要在使用Bazel构建工具的项目中使用glog。link
然后,您可以创建一个构建文件,并使用bazel build //src/main:main_logger构建它。
cc_binary(
name = "main_logger",
srcs = ["main_logger.cc"],
deps = ["@com_github_google_glog//:glog"],
)https://stackoverflow.com/questions/62327082
复制相似问题