【问题标题】:clang error compiling mongodb from source从源代码编译mongodb的clang错误
【发布时间】:2016-07-04 14:34:08
【问题描述】:

我对 mongodb 源文件进行了 git checkout,并正在尝试编译它。 我已将 gcc 作为 xcode-7.3.1 命令行工具的一部分安装

现在,当我尝试使用以下方法构建 mongodb 二进制文件时:

scons all

我收到以下错误:

scons: Reading SConscript files ...
scons version: 2.5.0
python version: 2 7 10 'final' 0
Checking whether the C compiler works... yes
Checking whether the C++ compiler works... yes
Checking that the C++ compiler can link a C++ program... yes
Checking if C++ compiler "g++" is GCC... no
Checking if C++ compiler "g++" is clang... yes
Checking if C compiler "gcc" is clang... no
C compiler does not match identified C++ compiler
See /Users/debashish.g/mongo-code/mongo/build/scons/config.log for details

在配置日志中显示:

scons: Configure: Checking if C compiler "gcc" is clang...
build/scons/sconf_temp/conftest_5.c <-
|
|#if defined(__clang__)
|/* we are using toolchain defined(__clang__) */
|#else
|#error
|#endif
|
gcc -o build/scons/sconf_temp/conftest_5.o -c     build/scons/sconf_temp/conftest_5.c
build/scons/sconf_temp/conftest_5.c:5:2: error: #error
#error
^~~~~
scons: Configure: no

我的gcc --version 显示:

Configured with: -- prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-   dir=/usr/include/c++/4.2.1
Apple LLVM version 7.3.0 (clang-703.0.31)
Target: x86_64-apple-darwin15.0.0
Thread model: posix
InstalledDir:   /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

这是叮当声。我在哪里做错了?请帮忙。我在这个问题上卡了很长时间。

【问题讨论】:

    标签: mongodb gcc build clang scons


    【解决方案1】:

    我错过的是 clang 和 llvm 工具。我检查了源文件并按照here 提到的步骤构建了 clang 工具。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-11-26
      • 2012-06-29
      • 1970-01-01
      • 2014-06-29
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多