使用SSL支持编译Mongod

时间:2014-12-15 17:18:11

标签: mongodb

我正在尝试从github src编译mongod.exe,但我一直遇到以下错误:

C:\Github\Mongo>scons --64 --ssl mongod.exe
scons: Reading SConscript files ...
scons version: 2.3.4
python version: 2 7 8 'final' 0
Checking whether the C++ compiler works... (cached) yes
Checking whether the C compiler works... (cached) yes
Checking if C++ compiler "$CC" is MSVC... (cached) yes
Checking if C compiler "cl" is MSVC... (cached) yes
Checking if C compiler is Microsoft Visual Studio 2013 Update 2 or newer...(cach
ed) yes
Checking if C++ compiler is Microsoft Visual Studio 2013 Update 2 or newer...(ca
ched) yes
Checking if target architecture is 32-bit x86...(cached) no
Checking if we are using libstdc++... (cached) no
Checking if we are on a POSIX system... (cached) no
Checking for __declspec(thread)... (cached) no
Checking for C++11 <atomic> support... (cached) no
Checking for C++ header file execinfo.h... (cached) no
Checking for C library pcap... (cached) no
Checking for C library wpcap... (cached) no
scons: done reading SConscript files.
scons: Building targets ...
cl /Fobuild\win32\64\ssl\mongo\db\db.obj /c src\mongo\db\db.cpp /TP /nologo /EHs
c /W3 /wd4355 /wd4800 /wd4267 /wd4244 /wd4290 /wd4068 /wd4351 /we4099 /Z7 /error
Report:none /MT /O2 /Oy- /Gw /Gy /Zc:inline /DBOOST_ALL_NO_LIB /D_SCONS /DMONGO_
EXPOSE_MACROS /DSUPPORT_UTF8 /DMONGO_OPTIMIZED_BUILD /DMONGO_BYTE_ORDER=1234 /D_
UNICODE /DUNICODE /D_CONSOLE /D_CRT_SECURE_NO_WARNINGS /DMONGO_SSL /D_WIN32_WINN
T=0x0502 /DNTDDI_VERSION=0x05020200 /IC:\Github\winpcap\Include /Isrc\third_part
y\s2 /Isrc\third_party\pcre-8.30 /Isrc\third_party\boost /Ibuild\win32\64\ssl /I
src /Z7
db.cpp
C:\Github\Mongo\src\mongo/platform/atomic_intrinsics.h(60) : fatal error C1189:
#error :  "Windows builds must use a compiler supporting std::atomic"
scons: *** [build\win32\64\ssl\mongo\db\db.obj] Error 2
scons: building terminated because of errors.

抛出错误的源代码显示变量_WIN32已定义并设置为True但我认为--64选项会将此设置为false?

有关如何解决完成SSL构建的任何建议,我们将不胜感激:

环境:来自github的Visual Studio 2013,Window 7,x64最新大师

观察:当我运行没有--ssl的scons并且编译继续进行时,C ++ 11支持是可用的,但是当使用--ssl选项时,支持的C ++ 11(原子)等于&#34; no&# 34;并且编译失败。

1 个答案:

答案 0 :(得分:0)

如果在构建过程中未找到OpenSSL,则会发生此错误。

  • 确保安装最新版本的OpenSSL(Win64 OpenSSL v1.0.1j)
  • 编译时使用--extrapath
  • 添加OpenSSL的主路径

示例构建命令:

  

scons --ssl --release --64 --extrapath =&lt; OPENSSL-HOME&gt;芯