首页 > mongodb c++driver 编译错误 -ssl

mongodb c++driver 编译错误 -ssl

环境mongodb3.2.8 c++driver 编译错误
OS:windos
mongodb version:3.2.8

我现在用C++的driver对mongodb进项操作,发现在再用到用户认证操作的时候,会报错。

要对C++驱动重新编译。需要加入参数-ssl。
前提条件,再追加这个-ssl的参数前我是可以编译通过c++这个驱动的!!!!
当我重新编译mongodb的c++驱动,命令如下
scons --64 --ssl --sharedclient --dynamic-windows --prefix="d:mongo_drive" --cpppath="C:boost" --libpath="d:mongo_driveboost_lib" install --dbg=on

编译失败。
报告的错误是:
file D:mongo_drivemongo-cxx-driver-legacySConstruct,line 1726:

Configure(confdir = build\scons\sconf_temp)

scons: Configure: Checking for SSL_version(NULL) in C library ssleay32...
buildsconssconf_tempconftest_9.c <-
|
|
|#include "openssl/ssl.h"
|
|int
|main() {
| SSL_version(NULL);
|return 0;
|}
|
cl /Fobuildsconssconf_tempconftest_9.obj /c buildsconssconf_tempconftest_9.c /nologo /EHsc /W3 /wd4244 /wd4251 /wd4267 /wd4275 /wd4290 /wd4355 /wd4800 /wd4068 /wd4351 /WX /Z7 /errorReport:none /MDd /Od /RTC1 /DMONGO_EXPOSE_MACROS /DBOOST_ALL_DYN_LINK /D_UNICODE /DUNICODE /DNOMINMAX /D_CONSOLE /D_CRT_NONSTDC_NO_WARNINGS /D_CRT_SECURE_NO_WARNINGS /D_CRT_SECURE_NO_DEPRECATE /D_SCL_SECURE_NO_WARNINGS /D_SCL_SECURE_NO_DEPRECATE /DMONGO_DEBUG_BUILD /D_WIN32_WINNT=0x0502 /DNTDDI_VERSION=0x05020200 /DMONGO_HAVE___DECLSPEC_THREAD /D_VARIADIC_MAX=10 /Ibuildwin3264dbg_ondynamic-windowssslthird_partygtest-1.7.0include /Ibuildwin3264dbg_ondynamic-windowsssl /Ibuildwin3264dbg_ondynamic-windowssslmongo /IC:boost
conftest_9.c
buildsconssconf_tempconftest_9.c(3) : fatal error C1083: 无法打开包括文件: “openssl/ssl.h”: No such file or directory
scons: Configure: no

找不到openssl/ssl.h。

我现在把openssl的
opensslinclude和openssllib这两个目录都追加到windows的path环境变量里了,但是还是没有解决这个编译问题。想问问各位如何解决。

【热门文章】
【热门文章】