提问人:asimes 提问时间:1/16/2014 更新时间:6/7/2014 访问量:4373
构建 Clang,libstdc++4.6 到 libstdc++4.7
Building Clang, libstdc++4.6 to libstdc++4.7
问:
我正在尝试按照以下方式构建 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)
答:
就在本周,LLVM & Clang 项目将最低编译器版本要求提高到 gcc 4.7,并带有 libstdc++。您需要安装或构建更新的 gcc。
这是一篇博文我今天早些时候写了一篇关于在 Ubuntu 12.04 上构建 gcc 4.8 并使用它来编译主干 LLVM 和 Clang 的文章。希望这会有所帮助!
评论
我遇到了同样的问题。构建 Clang 的最简单方法是使用 libc++ 而不是 libstdc++。如果您没有 libc++,可以通过安装 XCode 4.2(或更高版本)来获取它,也可以按照以下说明自行构建它: http://libcxx.llvm.org/
安装 libc++ 后,可以将 --enable-libcpp=yes 标志与 configure 命令一起使用。
评论
我在Mac 10.8.5 Xcode 5.0上遇到同样的错误 configure option --enable-libcpp 解决我的问题 ../llvm/configure --enable-cxx11 --enable-optimized --enable-libcpp
对我来说,发生这种情况是因为我之前从源代码构建的旧 clang 和 clang++(我试图构建以替换的那个)在我的 PATH 中排在第一位。这些都太老了。删除这两个文件,以便构建过程使用 XCode 的命令行工具附带的 clang 和 clang++,然后重新构建工作正常。
评论