I've been following the instructions on http://www.mongodb.org/about/tutorial/build-mongodb-with-visual-studio-2010/, basically1. Install Git 1.8.1.22. Install Python 2.7.33. Install OpenSSL-Win64-1.0.1e4. Download source5. Run "scons --ssl" from the mongo source directory
That gives " fatal error C1083: Cannot open include file: 'openssl/ssl.h': No such file or directory" so I found https://jira.mongodb.org/browse/BUILDBOT-193 and modified the command line to
scons --ssl --extrapath=c:\openssl-win64
That failed for me with "error C2065: '_WIN32_WINNT_VISTA' : undeclared identifier", so after a bit of googling I realized that this line from the scons output was key "Windows SDK Root 'C:/Program Files/Microsoft SDKs/Windows/v6.0a'". That's an older version of the Windows SDK, so I modified the command line to
scons --ssl --extrapath=C:\OpenSSL-Win64 --cpppath="c:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Include"
Which compiles but fails to link, showing these errorssock.obj : error LNK2001: unresolved external symbol _ERR_error_stringsock.obj : error LNK2001: unresolved external symbol _SSL_get_errorsock.obj : error LNK2001: unresolved external symbol _SSL_shutdownsock.obj : error LNK2001: unresolved external symbol _SSL_writesock.obj : error LNK2001: unresolved external symbol _SSL_freesock.obj : error LNK2001: unresolved external symbol _SSL_readsock.obj : error LNK2001: unresolved external symbol _ERR_get_errorssl_manager.obj : error LNK2001: unresolved external symbol _SSL_get_verify_resultssl_manager.obj : error LNK2001: unresolved external symbol _SSLv23_methodssl_manager.obj : error LNK2001: unresolved external symbol _SSL_CTX_set_session_id_contextssl_manager.obj : error LNK2001: unresolved external symbol _SSL_CTX_ctrlssl_manager.obj : error LNK2001: unresolved external symbol _ERR_error_string_nssl_manager.obj : error LNK2001: unresolved external symbol _SSL_CTX_get_cert_storessl_manager.obj : error LNK2001: unresolved external symbol _SSL_accept[snip]I've checked that the include directory looks correct - /LIBPATH:C:\OpenSSL-Win64\lib - and the scons command line is actually looking for the OpenSSL lib files libeay32.lib and ssleay32.lib, AND that
C:\OpenSSL-Win64\lib\ssleay32.lib & libeay32.lib are being read by link.exe (using procmon to check disk activity).
Any ideas? I'm out of them right now...I'm on Windows 7 64 bit, using Visual Studio 2010, compiling Mongo 2.4.3 with OpenSSL 1.0.1e (from the Win64OpenSSL-1_0_1e.exe installer)Thanks,Ed
--
--
You received this message because you are subscribed to the Google
Groups "mongodb-user" group.
To post to this group, send email to mongod...@googlegroups.com
To unsubscribe from this group, send email to
mongodb-user...@googlegroups.com
See also the IRC channel -- freenode.net#mongodb
---
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-user...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
On Wed, May 8, 2013 at 11:29 AM, Ed Norris <ed.norr...@gmail.com> wrote:
I've been following the instructions on http://www.mongodb.org/about/tutorial/build-mongodb-with-visual-studio-2010/, basically1. Install Git 1.8.1.22. Install Python 2.7.33. Install OpenSSL-Win64-1.0.1e4. Download source5. Run "scons --ssl" from the mongo source directoryWhat version of Scons? I'd recommend using SCons 2.3.0 if at all possible.
That gives " fatal error C1083: Cannot open include file: 'openssl/ssl.h': No such file or directory" so I found https://jira.mongodb.org/browse/BUILDBOT-193 and modified the command line to
scons --ssl --extrapath=c:\openssl-win64Are you intending a 64 bit build? Based on the name of the SSL library I'm guessing yes, in which case I'd recommend adding --64 to the build line. You should also specify --release, unless you want a debug build.
That failed for me with "error C2065: '_WIN32_WINNT_VISTA' : undeclared identifier", so after a bit of googling I realized that this line from the scons output was key "Windows SDK Root 'C:/Program Files/Microsoft SDKs/Windows/v6.0a'". That's an older version of the Windows SDK, so I modified the command line toThe complaint about _WIN32_WINNT_VISTA is a known defect: https://jira.mongodb.org/browse/SERVER-9408.scons --ssl --extrapath=C:\OpenSSL-Win64 --cpppath="c:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Include"I'm not sure this is sufficient, but, more importantly, the SConstruct should be locating SDK v7.0A if that is where it is installed:I'm not saying it is directly relevant to your problem, but I'd definitely recommend figuring out why the SDK location logic isn't finding the newer SDK, and repairing that, before going further.
Which compiles but fails to link, showing these errorssock.obj : error LNK2001: unresolved external symbol _ERR_error_stringsock.obj : error LNK2001: unresolved external symbol _SSL_get_errorsock.obj : error LNK2001: unresolved external symbol _SSL_shutdownsock.obj : error LNK2001: unresolved external symbol _SSL_writesock.obj : error LNK2001: unresolved external symbol _SSL_freesock.obj : error LNK2001: unresolved external symbol _SSL_readsock.obj : error LNK2001: unresolved external symbol _ERR_get_errorssl_manager.obj : error LNK2001: unresolved external symbol _SSL_get_verify_resultssl_manager.obj : error LNK2001: unresolved external symbol _SSLv23_methodssl_manager.obj : error LNK2001: unresolved external symbol _SSL_CTX_set_session_id_contextssl_manager.obj : error LNK2001: unresolved external symbol _SSL_CTX_ctrlssl_manager.obj : error LNK2001: unresolved external symbol _ERR_error_string_nssl_manager.obj : error LNK2001: unresolved external symbol _SSL_CTX_get_cert_storessl_manager.obj : error LNK2001: unresolved external symbol _SSL_accept[snip]I've checked that the include directory looks correct - /LIBPATH:C:\OpenSSL-Win64\lib - and the scons command line is actually looking for the OpenSSL lib files libeay32.lib and ssleay32.lib, AND thatCan you post the directory listing of the lib directory? Also the 'dumpbin /exports' of the libraries in there might be useful.
C:\OpenSSL-Win64\lib\ssleay32.lib & libeay32.lib are being read by link.exe (using procmon to check disk activity).It is a little hard to tell without more information. Can you please post the actual link line that is failing? You can omit the long list of .o files to make it more readable.
C:\Dev\mongo>scons --ssl --extrapath=c:\openssl-win64 --cpppath="c:\program files (x86)\Microsoft SDKs\Windows\v7.0A\Include"
scons: Reading SConscript files ...
scons version: 2.3.0
python version: 2 7 3 'final' 0
found visual studio at c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN
Windows SDK Root 'C:/Program Files/Microsoft SDKs/Windows/v6.0a'
Checking whether the C++ compiler works(cached) yes
Checking for C header file unistd.h... (cached) no
Checking whether clock_gettime is declared... (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 ...
generate_buildinfo(["build\buildinfo.cpp"], ['\n#include <string>\n#include <boost/version.hpp>\n\n#include "mongo/util/version.h"\n\nnamespace mongo
{\n const char * gitVersion() { return "%(git_version)s"; }\n const char * compiledJSEngine() { return "%(js_engine)s"; }\n const char * allo
cator() { return "%(allocator)s"; }\n const char * loaderFlags() { return "%(loader_flags)s"; }\n const char * compilerFlags() { return "%(compi
ler_flags)s"; }\n std::string sysInfo() { return "%(sys_info)s BOOST_LIB_VERSION=" BOOST_LIB_VERSION ; }\n} // namespace mongo\n'])
Using tempfile c:\users\me\appdata\local\temp\tmp1kcn3f.lnk for command line:
link /nologo /LTCG /DEBUG /LARGEADDRESSAWARE /NODEFAULTLIB:MSVCPRT "/OUT:build\win32\cpppath_c__program files (x86)_Microsoft SDKs_Windows_v7.0A_Inclu
de\extrapath_c__openssl-win64\ssl\mongo\mongod.exe" /LIBPATH:C:\openssl-win64\lib /LIBPATH:C:\openssl-win64\lib64 "/LIBPATH:C:\Program Files\Microsoft
SDKs\Windows\v6.0a\Lib" /LIBPATH:C:\Dev\mongo\source2\winpcap\Lib [snip a bunch of obj files]
link @c:\users\me\appdata\local\temp\tmp1kcn3f.lnk
Using tempfile c:\users\me\appdata\local\temp\tmpt17dwi.lnk for command line:
link /nologo /LTCG /DEBUG /LARGEADDRESSAWARE /NODEFAULTLIB:MSVCPRT "/OUT:build\win32\cpppath_c__program files (x86)_Microsoft SDKs_Windows_v7.0A_Inclu
de\extrapath_c__openssl-win64\ssl\mongo\mongod.exe" /LIBPATH:C:\openssl-win64\lib /LIBPATH:C:\openssl-win64\lib64 "/LIBPATH:C:\Program Files\Microsoft
SDKs\Windows\v6.0a\Lib" /LIBPATH:C:\Dev\mongo\source2\winpcap\Lib [snip more obj files]
sock.obj : error LNK2001: unresolved external symbol _ERR_error_string
sock.obj : error LNK2001: unresolved external symbol _SSL_get_error
sock.obj : error LNK2001: unresolved external symbol _SSL_shutdown
sock.obj : error LNK2001: unresolved external symbol _SSL_write
[snip more link errors]
build\win32\cpppath_c__program files (x86)_Microsoft SDKs_Windows_v7.0A_Include\extrapath_c__openssl-win64\ssl\mongo\mongod.exe : fatal error LNK1120:
41 unresolved externals
scons: *** [build\win32\cpppath_c__program files (x86)_Microsoft SDKs_Windows_v7.0A_Include\extrapath_c__openssl-win64\ssl\mongo\mongod.exe] Error 112
0 I struggled a lot with the task to build MongoDb with SSL on Windows the last days and this post helped me a lot.
I tried this on a Windows 8 and 7 where Visual Studio 2010 and Visual Studio 2012 were both installed.
Scons finds and uses the VS 2012 compiler which finishes with an error. I attached the console output.
Finally I found an old PC with only Visual Studio 2010 installed and there the build works fine.
Is there a possibility to configure scons that it uses the VS 2010 instead of the VS 2012?