3 / 3
Oct 2024

I just attempted to build mongo-cxx-driver with VS2022. All seems to go well, but the installed .DLL’s have very strange names. Here’s my history:
curl -OL https://github.com/mongodb/mongo-cxx-driver/releases/download/r3.11.0/mongo-cxx-driver-r3.11.0.tar.gz
tar -xf mongo-cxx-driver-r3.11.0.tar.gz
cd mongo-cxx-driver-r3.11.0
cd build/
cmake … -DCMAKE_INSTALL_PREFIX=c:/packages/vs2022/libmongo-cxx-driver -DMONGOCXX_OVERRIDE_DEFAULT_INSTALL_PREFIX=OFF -DBUILD_SHARED_AND_STATIC_LIBS=ON -DCMAKE_BUILD_TYPE=Release -DENABLE_TESTS=OFF -DCMAKE_CXX_STANDARD=20
cmake --build . --parallel
cmake --build . --target install

This all seems to work fine. However, the names of the .DLL and .lib files for the “cxx” libraries are not as expected, resulting in link errors when I attempt to use it to build my application. Is this behavior expected?

/c/packages/vs2022/libmongo-cxx-driver/bin: bson-1.0.dll* concrt140.dll* mongocxx-v_noabi-dhs-x64-v143-mdd.dll* msvcp140_1.dll* msvcp140_atomic_wait.dll* vcruntime140.dll* bsoncxx-v_noabi-dhs-x64-v143-mdd.dll* mongoc-1.0.dll msvcp140.dll* msvcp140_2.dll* msvcp140_codecvt_ids.dll* vcruntime140_1.dll* /c/packages/vs2022/libmongo-cxx-driver/include: bsoncxx/ libbson-1.0/ libmongoc-1.0/ mongocxx/ /c/packages/vs2022/libmongo-cxx-driver/lib: bson-1.0.lib bsoncxx-static-dhs-x64-v143-mdd.lib cmake/ mongoc-static-1.0.lib mongocxx-v_noabi-dhs-x64-v143-mdd.lib bson-static-1.0.lib bsoncxx-v_noabi-dhs-x64-v143-mdd.lib mongoc-1.0.lib mongocxx-static-dhs-x64-v143-mdd.lib pkgconfig/ /c/packages/vs2022/libmongo-cxx-driver/share: mongo-c-driver/ mongo-cxx-driver/ `

This change was part of the 3.10 release. Please see the release notes for details.

  • Library filenames, when compiled with MSVC (as detected by CMake’s MSVC variable), are now embedded with an ABI tag string, e.g. bsoncxx-v_noabi-rhs-x64-v142-md.lib.
    • This new behavior is enabled by default; disable by setting ENABLE_ABI_TAG_IN_LIBRARY_FILENAMES=OFF when configuring the CXX Driver.
    • The ABI tag string can also be embedded in pkg-config metadata filenames, e.g. libbsoncxx-v_noabi-rhs-x64-v142-md.pc. This is disabled by default; enable by setting ENABLE_ABI_TAG_IN_PKGCONFIG_FILENAMES=ON (requires ENABLE_ABI_TAG_IN_LIBRARY_FILENAMES=ON).

Closed on Oct 25, 2024

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