2016-07-04 56 views
0

我参加了一个mongodb源文件的git签出,并试图编译它。 我安装的gcc作为Xcode的-7.3.1的命令行工具的一部分叮咚错误从源代码编译mongodb

现在,当我试图用建立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 

这是叮当声。我在哪里做错了?请帮忙。我现在已经陷入了很长时间。

回答

0

我错过的是clang和llvm工具。我检查了源文件并根据here提到的步骤构建了叮当声工具。