Hello, I’m new to MongoDB, and I’m trying to build the mongo-c-driver, the version is 1.25.0. However, some errors are appears in the build process. The CMake output and the Visual Studio 2019 error output are shown below.
CMAKE:
Found Python: D:/anaconda3/python.exe (found version “3.11.5”) found components: Interpreter
Selecting Windows SDK version 10.0.19041.0 to target Windows 10.0.19045.
The C compiler identification is MSVC 19.29.30154.0
Detecting C compiler ABI info
Detecting C compiler ABI info - done
Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Professional/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x64/cl.exe - skipped
Detecting C compile features
Detecting C compile features - done
Performing Test CMAKE_HAVE_LIBC_PTHREAD
Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
Looking for pthread_create in pthreads
Looking for pthread_create in pthreads - not found
Looking for pthread_create in pthread
Looking for pthread_create in pthread - not found
Found Threads: TRUE
Looking for a CXX compiler
Looking for a CXX compiler - C:/Program Files (x86)/Microsoft Visual Studio/2019/Professional/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x64/cl.exe
The CXX compiler identification is MSVC 19.29.30154.0
Detecting CXX compiler ABI info
Detecting CXX compiler ABI info - done
Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Professional/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x64/cl.exe - skipped
Detecting CXX compile features
Detecting CXX compile features - done
Found Python3: D:/anaconda3/python.exe (found version “3.11.5”) found components: Interpreter
Using bundled libbson
Looking for snprintf
Looking for snprintf - found
Performing Test BSON_HAVE_TIMESPEC
Performing Test BSON_HAVE_TIMESPEC - Success
Looking for gmtime_r
Looking for gmtime_r - not found
Looking for rand_r
Looking for rand_r - not found
Looking for strings.h
Looking for strings.h - not found
Looking for strlcpy
Looking for strlcpy - not found
Looking for stdbool.h
Looking for stdbool.h - found
Looking for clock_gettime
Looking for clock_gettime - not found
Looking for strnlen
Looking for strnlen - found
Looking for sched_getcpu
Looking for sched_getcpu - not found
libmongoc version (from VERSION_CURRENT file): 1.25.0
Enabling zlib compression (bundled)
Looking for include file unistd.h
Looking for include file unistd.h - not found
Looking for include file stdarg.h
Looking for include file stdarg.h - found
Searching for compression library zstd
Could NOT find PkgConfig (missing: PKG_CONFIG_EXECUTABLE)
Not found
libmongoc TLS : SecureChannel
Using SASL backend : SSPI
Looking for sys/types.h
Looking for sys/types.h - found
Looking for stdint.h
Looking for stdint.h - found
Looking for stddef.h
Looking for stddef.h - found
Check size of socklen_t
Check size of socklen_t - done
Searching for compression library header snappy-c.h
Found in D:/anaconda3/Library/include
Searching for libsnappy
Found D:/anaconda3/Library/lib/snappy.lib
Searching for libmongocrypt
libmongocrypt not found. Configuring without Client-Side Field Level Encryption support.
Performing Test MONGOC_HAVE_SS_FAMILY
Performing Test MONGOC_HAVE_SS_FAMILY - Failed
Compiling against Windows SSPI
Enabling utf8proc (bundled)
Building with MONGODB-AWS auth support
Build files generated for:
build system: Visual Studio 16 2019
instance: C:/Program Files (x86)/Microsoft Visual Studio/2019/Professional
instance: x64
The following features have been enabled:
- TLS, for secure network communication (SecureChannel)
- Cryptography, cryptographic primitives (SecureChannel)
- AWS Authentication, authenticate with MongoDB servers using credentials from AWS instance metadata
- SASL Authentication, authenticate with MongoDB servers using SASL: “Simple Authentication and Security Layer” (SSPI)
Configuring done (17.0s)
Generating done (2.3s)
Visual Studio 2019 errors:
|Error|C2065|‘_bsonDSL_Type_int’: undeclared identifier|mongoc_shared|E:\mongo-c-driver-src\src\libmongoc\src\mongoc\mongoc-uri.c|1784||
|Error|C4013|‘_bsonVisitIterAs_int’ undefined; assuming extern returning int|mongoc_static|E:\mongo-c-driver-src\src\libmongoc\src\mongoc\mongoc-uri.c|1779||
Can anyone help me fix it ? Thanks.