Open zedzhu opened 1 year ago
Hi @zedzhu, Can you please update the issue with complete information along with a clear title. Thanks !
OK, updated, could you see if it's ok now?
If I'm not mistaken, macOS has the libc++
implementation of the standard library by default. So I would try two things:
-lstdc++
to lc++
/opt/homebrew/opt/llvm/include/c++/v1
that Bazel suggests is missing to the cxx_builtin_include_directories
list.Disclosure: I'm a beginner so this might be not the right way of solving this issue, I'm here because I have the same issue in a different context :)
Thank you for contributing to the Bazel repository! This issue has been marked as stale since it has not had any activity in the last 1+ years. It will be closed in the next 90 days unless any other activity occurs. If you think this issue is still relevant and should stay open, please post any comment here and the issue will no longer be marked as stale.
Page link:
https://bazel.build/tutorials/ccp-toolchain-config?hl=en
example link: https://github.com/bazelbuild/examples/tree/main/cpp-tutorial/stage3
Problem description (include actual vs expected text, if applicable):
I followed the instructions of the documentation on my macOS Monterey(12.3) with Apple M1 Pro chipset and failed to build:
$ bazel build --config=clang_config --verbose_failures //main:hello-world INFO: Analyzed target //main:hello-world (1 packages loaded, 10 targets configured). INFO: Found 1 target... ERROR: /Users/carlzhu/github/fun_algs/bazel/cpp-tutorial/stage5/main/BUILD:3:11: Compiling main/hello-greet.cc failed: undeclared inclusion(s) in rule '//main:hello-greet': this rule is missing dependency declarations for the following files included by 'main/hello-greet.cc': '/opt/homebrew/opt/llvm/include/c++/v1/string' '/opt/homebrew/opt/llvm/include/c++/v1/algorithm/max.h' '/opt/homebrew/opt/llvm/include/c++/v1/algorithm/comp.h' '/opt/homebrew/opt/llvm/include/c++/v1/config' '/opt/homebrew/opt/llvm/include/c++/v1/config_site' '/opt/homebrew/opt/llvm/include/c++/v1/algorithm/comp_ref_type.h' '/opt/homebrew/opt/llvm/include/c++/v1/debug' '/opt/homebrew/opt/llvm/include/c++/v1/assert' '/opt/homebrew/opt/llvm/include/c++/v1/verbose_abort' '/opt/homebrew/opt/llvm/include/c++/v1/availability' '/opt/homebrew/opt/llvm/include/c++/v1/type_traits/is_constant_evaluated.h' '/opt/homebrew/opt/llvm/include/c++/v1/cstddef' '/opt/homebrew/opt/llvm/include/c++/v1/type_traits/enable_if.h' '/opt/homebrew/opt/llvm/include/c++/v1/type_traits/integral_constant.h' '/opt/homebrew/opt/llvm/include/c++/v1/type_traits/is_integral.h' '/opt/homebrew/opt/llvm/include/c++/v1/type_traits/remove_cv.h' '/opt/homebrew/opt/llvm/include/c++/v1/type_traits/remove_const.h' '/opt/homebrew/opt/llvm/include/c++/v1/type_traits/remove_volatile.h' '/opt/homebrew/opt/llvm/include/c++/v1/version' '/opt/homebrew/opt/llvm/include/c++/v1/stddef.h' '/opt/homebrew/Cellar/llvm/16.0.6/lib/clang/16/include/stddef.h' '/opt/homebrew/Cellar/llvm/16.0.6/lib/clang/16/include/stddef_max_align_t.h' '/opt/homebrew/opt/llvm/include/c++/v1/utility/declval.h' '/opt/homebrew/opt/llvm/include/c++/v1/algorithm/max_element.h' '/opt/homebrew/opt/llvm/include/c++/v1/iterator/iterator_traits.h' '/opt/homebrew/opt/llvm/include/c++/v1/concepts/arithmetic.h' '/opt/homebrew/opt/llvm/include/c++/v1/type_traits/is_floating_point.h'
Where do you see this issue? (include link to specific section of the page, if applicable)
No response
Any other information you'd like to share?
.bazelrc file content:
toolchain/BUILD file content:
toolchain/cc_toolchain_config file content: