c++ - 无法构建 lldb - 'atomic' 文件未找到

标签 c++ macos compiler-errors clang lldb

我正在尝试构建lldb,它是 Clang/LLVM 3.4.2 下载的一部分,地址为 LLVM Download Page .

我可以构建 LLVM、Clang、Compiler-RT 和 Extras。但是,当我将 LLDB 添加到我的配方中时,构建失败:

llvm[3]: Compiling lldb.cpp for Release+Asserts build
llvm[3]: Compiling lldb-log.cpp for Release+Asserts build
In file included from /Users/jeffrey/Clang-3.4.2/llvm/tools/lldb/source/lldb-log.cpp:10:
In file included from /Users/jeffrey/Clang-3.4.2/llvm/tools/lldb/source/../include/lldb/lldb-private-log.h:17:
In file included from /Users/jeffrey/Clang-3.4.2/llvm/tools/lldb/source/../include/lldb/lldb-private.h:19:
In file included from /Users/jeffrey/Clang-3.4.2/llvm/tools/lldb/source/../include/lldb/lldb-public.h:13:
In file included from /Users/jeffrey/Clang-3.4.2/llvm/tools/lldb/source/../include/lldb/lldb-defines.h:13:
In file included from /Users/jeffrey/Clang-3.4.2/llvm/tools/lldb/source/../include/lldb/lldb-types.h:14:
In file included from /Users/jeffrey/Clang-3.4.2/llvm/tools/lldb/source/../include/lldb/lldb-forward.h:15:
/Users/jeffrey/Clang-3.4.2/llvm/tools/lldb/source/../include/lldb/Utility/SharingPtr.h:22:10: fatal error: 
      'atomic' file not found
#include <atomic>
         ^
In file included from /Users/jeffrey/Clang-3.4.2/llvm/tools/lldb/source/lldb.cpp:12:
In file included from /Users/jeffrey/Clang-3.4.2/llvm/tools/lldb/source/../include/lldb/lldb-private.h:19:
In file included from /Users/jeffrey/Clang-3.4.2/llvm/tools/lldb/source/../include/lldb/lldb-public.h:13:
In file included from /Users/jeffrey/Clang-3.4.2/llvm/tools/lldb/source/../include/lldb/lldb-defines.h:13:
In file included from /Users/jeffrey/Clang-3.4.2/llvm/tools/lldb/source/../include/lldb/lldb-types.h:14:
In file included from /Users/jeffrey/Clang-3.4.2/llvm/tools/lldb/source/../include/lldb/lldb-forward.h:15:
/Users/jeffrey/Clang-3.4.2/llvm/tools/lldb/source/../include/lldb/Utility/SharingPtr.h:22:10: fatal error: 
      'atomic' file not found
#include <atomic>
         ^
1 error generated.

按照 Building LLDB 的要求,LLDB 已在 Clang 旁边解压。 :

llvm
|
`-- tools
    |
    +-- clang
    |
    `-- lldb

LLDB 正在按照请求构建在构建目录中(就像其他所有内容一样):

mkdir build
cd build
../llvm/configure --enable-optimized --prefix=/usr/local
make -j4

我发现 LLDB @ Mac OSX: build on Snow Leopard (still) supported? 中讨论了类似的问题。但是,建议的解决方案是从命令行使用 xcodebuild 转动一些旋钮。我没有使用 Xcode,所以它不是我的替代方案。

我的环境是 OS X 10.8.5,x64,已完全修补。 Xcode 版本 5.1.1 (5B1008)。我在 usr/local/ 中安装了 Clang 3.4.2(没有 lldb),但我不相信它被使用。

如何从命令行构建 lldb?

最佳答案

在运行“configure”脚本时添加“--enable-cxx11”开关。

默认情况下禁用 c++11。

有关更多信息,请运行“configure --help”

关于c++ - 无法构建 lldb - 'atomic' 文件未找到,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24909597/

相关文章:

c++ - 我可以从具有不同数字分隔符的 istream 中读取 double 值吗?

c++ - Boost.asio 和异步链,unique_ptr?

C++:找不到静态链接

macos - 是否可以在 Mac OS 上调试 x64 程序集?

macos - pycharm 在 Mac 上无故崩溃?

c++ - 无法编译 mongodb 2.0 c++ 驱动程序

Scala:不是合法的形式参数

c++ - 为什么我缺少模板参数?

c - 在 clang 中使用 realloc 来缩小内存

c# - 忽略另一个项目中的错误以在解决方案中运行当前项目