2016-07-04 59 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提到的步驟構建了叮噹聲工具。