【问题标题】:Building Clang, libstdc++4.6 to libstdc++4.7构建 Clang、libstdc++4.6 到 libstdc++4.7
【发布时间】:2014-01-16 06:29:45
【问题描述】:

我正在尝试按照以下方式构建 Clang:http://clang.llvm.org/get_started.html

在第 6 步,命令 ../llvm/configure 运行一系列检查并告诉我:

checking whether Clang will select a modern C++ standard library... no
configure: error:
We detected a missing feature in the standard C++ library that was known to be
missing in libstdc++4.6 and implemented in libstdc++4.7. There are numerous
C++11 problems with 4.6's library, and we don't support GCCs or libstdc++ older
than 4.7. You will need to update your system and ensure Clang uses the newer
standard library.

If this error is incorrect or you need to force things to work, you may pass
'--disable-compiler-version-checks' to configure to bypass this test.

我不知道如何解决这个问题,谷歌搜索 libstdc++4.7 并没有产生任何对我有用或我理解的东西。我该如何更换/升级它?我在 Mac (10.7.5) 上

【问题讨论】:

    标签: clang llvm libstdc++


    【解决方案1】:

    我遇到了同样的问题。构建 Clang 的最简单方法是使用 libc++ 而不是 libstdc++。如果您没有 libc++,您可以通过安装 XCode 4.2(或更高版本)来获取它,或者您可以按照此处的说明自行构建:http://libcxx.llvm.org/

    安装 libc++ 后,您可以在配置命令中使用 --enable-libcpp=yes 标志。

    【讨论】:

    • 我最终需要自己制作,这很有效,谢谢
    • 这仅适用于 MacOSX,因为 libcxx 目前仅适用于 MacOSX。在其他 Unix/Linux 上,我认为唯一的解决方案是以某种方式安装 libstdc++4.7。
    【解决方案2】:

    就在本周,LLVM & Clang 项目将最低编译器版本要求提高到了 gcc 4.7,并使用了 libstdc++。您需要安装或构建更新的 gcc。

    Here's a blog post 我今天早些时候写过关于在 Ubuntu 12.04 上构建 gcc 4.8 并使用它来编译主干 LLVM 和 Clang。希望这会有所帮助!

    【讨论】:

    • 我找到了将 gcc 升级到 4.7(适用于 Mac)的链接,但不幸的是我仍然收到相同的消息。 jamesreubenknowles.com/how-to-install-gcc-4-7-on-mac-os-x-1774
    • @asimes:你确定 gcc 4.7 安装在配置脚本可以找到的位置吗?
    • 老实说,我不知道如何确定,但我找到了解决问题的不同方法
    【解决方案3】:

    我在 mac 10.8.5 xcode 5.0 上遇到同样的错误 配置选项 --enable-libcpp 解决我的问题 ../llvm/configure --enable-cxx11 --enable-optimized --enable-libcpp

    【讨论】:

      【解决方案4】:

      对我来说,发生这种情况是因为我之前从源代码构建的旧 clang 和 clang++(我试图构建来替换的那个)在我的 PATH 中排在第一位。这些都太旧了。删除这两个文件,以便构建过程使用 XCode 命令行工具附带的 clang 和 clang++,然后重建工作正常。

      【讨论】:

        猜你喜欢
        • 2015-10-15
        • 2023-03-03
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2014-03-04
        • 1970-01-01
        相关资源
        最近更新 更多