2 / 4
Nov 2024

Hello

I am trying to build the MongoDB CXX 3.11.0 driver. Bet build fails when I try to configure the driver build.

I My calling syntax is: D:\4_LibraryBuild\mongo-cxx-driver-r3.11.0>cmake.exe -G “Visual Studio 15 2017” -A “x64” -DCMAKE_CXX_STANDARD=17 -DCMAKE_PREFIX_PATH=“D:\4_LibraryBuild\01_lib-build\MongoC”

I am using CMake 3.22.3

The output is as folowed:

D:\4_LibraryBuild\mongo-cxx-driver-r3.11.0>cmake.exe -G "Visual Studio 15 2017" -A "x64" -DCMAKE_CXX_STANDARD=17 -DCMAKE_PREFIX_PATH="D:\4_LibraryBuild\01_lib-build\MongoC" CMake Warning: No source or binary directory provided. Both will be assumed to be the same as the current working directory, but note that this warning will become a fatal error in future CMake releases. -- Selecting Windows SDK version 10.0.26100.0 to target Windows 10.0.22631. -- The CXX compiler identification is MSVC 19.16.27051.0 -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Professional/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x64/cl.exe - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done -- Found libmongoc 1.28.1, don't need to download it. CMake Warning at CMakeLists.txt:194 (message): mongocxx: The default CMAKE_INSTALL_PREFIX is being overridden to the build directory. This behavior will not be the default in a future release. Build with 'MONGOCXX_OVERRIDE_DEFAULT_INSTALL_PREFIX=OFF' to opt into what will be the default behavior in a future release. Setting install path to: D:/4_LibraryBuild/mongo-cxx-driver-r3.11.0/install -- The C compiler identification is MSVC 19.16.27051.0 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Professional/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x64/cl.exe - skipped -- Detecting C compile features -- Detecting C compile features - done -- bsoncxx version: 3.11.0 -- Auto-configuring bsoncxx to use C++17 std library polyfills since C++17 is active and user didn't specify otherwise -- found libbson version 1.28.1 -- Performing Test COMPILER_HAS_DEPRECATED_ATTR -- Performing Test COMPILER_HAS_DEPRECATED_ATTR - Failed -- Downloading Catch2... Microsoft (R) Build Engine version 15.9.21+g9802d43bc3 for .NET Framework Copyright (C) Microsoft Corporation. All rights reserved. Checking Build System Creating directories for 'ep_catch2-populate' Building Custom Rule D:/4_LibraryBuild/mongo-cxx-driver-r3.11.0/_deps/ep_catch2-subbuild/CMakeLists.txt Performing download step (git clone) for 'ep_catch2-populate' CMake Error at ep_catch2-subbuild/ep_catch2-populate-prefix/src/ep_catch2-populate-stamp/ep_catch2-populate-download-Debug.cmake:49 (message): Command failed: 1 'C:/Program Files/CMake/bin/cmake.exe' '-P' 'D:/4_LibraryBuild/mongo-cxx-driver-r3.11.0/_deps/ep_catch2-subbuild/ep_catch2-populate-prefix/tmp/ep_catch2-populate-gitclone.cmake' See also D:/4_LibraryBuild/mongo-cxx-driver-r3.11.0/_deps/ep_catch2-subbuild/ep_catch2-populate-prefix/src/ep_catch2-populate-stamp/ep_catch2-populate-download-*.log C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets(209,5): error MSB6006: "cmd.exe" exited with code 1. [D:\4_LibraryBuild\mongo-cxx-driver-r3.11.0\_deps\ep_catch2-subbuild\ep_catch2-populate.vcxproj] CMake Error at C:/Program Files/CMake/share/cmake-3.22/Modules/FetchContent.cmake:1087 (message): Build step for ep_catch2 failed: 1 Call Stack (most recent call first): C:/Program Files/CMake/share/cmake-3.22/Modules/FetchContent.cmake:1216:EVAL:2 (__FetchContent_directPopulate) C:/Program Files/CMake/share/cmake-3.22/Modules/FetchContent.cmake:1216 (cmake_language) C:/Program Files/CMake/share/cmake-3.22/Modules/FetchContent.cmake:1259 (FetchContent_Populate) cmake/FetchCatch2.cmake:38 (FetchContent_MakeAvailable) cmake/FetchCatch2.cmake:51 (fetch_catch2) src/bsoncxx/test/CMakeLists.txt:15 (include) -- Configuring incomplete, errors occurred! See also "D:/4_LibraryBuild/mongo-cxx-driver-r3.11.0/CMakeFiles/CMakeOutput.log". See also "D:/4_LibraryBuild/mongo-cxx-driver-r3.11.0/CMakeFiles/CMakeError.log".

For me it looks like “Catch2” could not be downloaded. Important is that I am behind a company firewall, and a download will not be accepted.
Is there a way to download and configure “Catch2” manually?

Best regards
Thomas

8 days later

Closed on Nov 19, 2024

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.

Hello Rishabh_Bisht

I tried this way and it was working. Thank you for this!!! :+1:

I solved my problem in a “different” way. I was setting a proxy server in CMAKE in the environment variables since I know the company proxy server. I set this environment variables in the Visual Studio command prompt before calling CMake:

set HTTP_PROXY=“http://Proxyservername
set HTTPS_PROXY=“https://Proxyservername

After setting the environment variables, CMake was able to download “Catch2”.