Could not find a configuration file for package "libbson-1.0" that is compatible with requested version "1.24.0"

Hi, all, I still met the following ERROR while building mongo-cxx-driver today.

 No build type selected, default is Release
 bsoncxx version: 3.8.0
 CMake Error at src/bsoncxx/CMakeLists.txt:114 (find_package):
   Could not find a configuration file for package "libbson-1.0" that is
   compatible with requested version "1.24.0".

   The following configuration files were considered but not accepted:

     /usr/local/lib/cmake/libbson-1.0/libbson-1.0-config.cmake, version: 1.0.0


 Configuring incomplete, errors occurred!

I’m building mongo-cxx-driver under Ubuntu 22.04, and I’ve already successfully built and installed mongo-c-driver and libmongocrypt from source.

By the way, libbson was automatically installed together with libmongoc while I installed mongo-c-driver.

Did anybody meet the same issue?

Cheers

Problem solved by modifying the versions in the following 4 files:

/usr/local/lib/cmake/libbson-1.0/libbson-1.0-config.cmake
/usr/local/lib/cmake/libbson-1.0/libbson-1.0-config-version.cmake
/usr/local/lib/cmake/libmongoc-1.0/libmongoc-1.0-config.cmake
/usr/local/lib/cmake/libmongoc-1.0/libmongoc-1.0-config-version.cmake

Have to manually sync all versions… Looks like 1.24.0 or 1.24.1 is the newest version, but NEVER being shown in the above configuration files.

Hi @Pei_JIA, I am curious to know the C driver version that you built & installed? Was it not 1.24 or 1.24.1?

It is 1.24.1. But whether I leave BUILD_VERSION as its original value 0.0.0, or I modify it into 1.24.1, what I built out by make is ALWAYS version *1.0.

✗ find . -depth -iname "*.so" 
./src/libbson/libbson-1.0.so
./src/libmongoc/libmongoc-1.0.so

What can I say??? Why is it so??

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