gpt4 book ai didi

clang - 为什么 clang/llvm 在构建碳时使用 Bazel 向我抛出这个错误

转载 作者:行者123 更新时间:2023-12-05 05:35:26 27 4
gpt4 key购买 nike

所以我正在尝试构建 carbon-lang我已经完成了一切,安装了 clang/llvm 它工作正常但是当我运行命令时 bazel run//explorer -- ./explorer/testdata/print/format_only.carbon它给了我这个错误我用谷歌搜索但找不到解决这个错误的方法:

[bret@archxbret carbon-lang]$ bazel run //explorer -- ./explorer/testdata/print/format_only.carbon 
Starting local Bazel server and connecting to it...
INFO: Invocation ID: 6fb0bb2c-cc78-4fb0-8e35-90759b75109d
INFO: Analyzed target //explorer:explorer (67 packages loaded, 1567 targets configured).
INFO: Found 1 target...
ERROR: /home/bret/.cache/bazel/_bazel_bret/e6835bf0f6859c4bbbb42f026d02cce5/external/m4_v1.4.18/bin/BUILD. bazel:2:10: Linking external/m4_v1.4.18/bin/m4 (for host] failed: (Exit 1):
clang++ failed: error executing command /us r/bin/clang++ Obazel-out/host/bin/external/m4_v1.4.18/bin/m4-2.params

Jse --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
ld.lld: error: unable to find library -lc++
ld.lld: error: unable to find library -l:libunwind.a
ld.lld: error: unable to find library -l:libunwind.a
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
Target //explorer:explorer failed to build
Jse --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 29.584s, Critical Path: 0.68s
INFO: 2 processes: 2 internal.
FAILED: Build did NOT complete successfully
FAILED: Build did NOT complete successfully

我正在使用 arch Linux 非常感谢任何帮助我已经尝试将 llvm 添加到路径但它似乎不起作用。llvm 在/usr/include/llvm 中,但是当我将它添加到我的 .bashrc 并获取它时,它会出现在我 echo $PATH 但是当我运行命令 which llvm 它表明在当前添加到 PATH 目录时没有找到 llvm但是命令 llvm-config --version 有效,所以我不确定这是否意味着它已经添加到 PATH 中。我真的迷失在这里任何帮助表示赞赏。如果我犯了一个明显的错误,请提前道歉。

最佳答案

因此,在严格搜索此错误的解决方案后,发现 carbon 与系统安装的 clangllvm 版本存在问题,现在如果您需要 carbon -lang 工作你必须安装 llvmhomebrew

关于clang - 为什么 clang/llvm 在构建碳时使用 Bazel 向我抛出这个错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/73516840/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com