Compiling mongo-cxx-driver-r3.6.1

Hi, I’m having some issues compiling mongo-cxx-driver-r3.6.1

Could not find a package configuration file provided by “libbson-1.0”
(requested version 1.13.0) with any of the following names:

libbson-1.0Config.cmake
libbson-1.0-config.cmake

I downloaded and compiled the mongo-c-driver

Is there any documentation on compiling the cxx driver? it’s missing from the README

@chris_d, C++ driver installation instructions can be found here: Installing the mongocxx driver

However, your post does not include any sort of information that might be useful in diagnosing the issue. If you are still experiencing issues after following the installation instructions at the link, please post the complete sequence of commands and all associated output for both the C driver build/installation and C++ driver build/installation.

chris@nuc8i7:~/mongo$ cd mongo-c-driver-1.17.2
chris@nuc8i7:~/mongo/mongo-c-driver-1.17.2$ mkdir cmake-build
chris@nuc8i7:~/mongo/mongo-c-driver-1.17.2$ cd cmake-build
chris@nuc8i7:~/mongo/mongo-c-driver-1.17.2/cmake-build$ cmake -DENABLE_AUTOMATIC_INIT_AND_CLEANUP=OFF …
– The C compiler identification is ;GNU 8.3.0
– Check for working C compiler: /usr/bin/cc
– Check for working C compiler: /usr/bin/cc – works
– Detecting C compiler ABI info
– Detecting C compiler ABI info - done
– Detecting C compile features
– Detecting C compile features - done
– No CMAKE_BUILD_TYPE selected, defaulting to RelWithDebInfo
file VERSION_CURRENT contained BUILD_VERSION 1.17.2
– Build and install static libraries
– Using bundled libbson
libbson version (from VERSION_CURRENT file): 1.17.2
– Check if the system is big endian
– Searching 16 bit integer
– 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 unsigned short
– Check size of unsigned short - done
– Using unsigned short
– Check if the system is big endian - little endian
– Looking for snprintf
– Looking for snprintf - found
– Looking for reallocf
– Looking for reallocf - not found
– Performing Test BSON_HAVE_TIMESPEC
– Performing Test BSON_HAVE_TIMESPEC - Success
– struct timespec found
– Looking for gmtime_r
– Looking for gmtime_r - found
– Looking for rand_r
– Looking for rand_r - found
– Looking for strings.h
CMake Warning (dev) at CMakeLists.txt:10 (_message):
Policy CMP0075 is not set: Include file check macros honor
CMAKE_REQUIRED_LIBRARIES. ;Run “cmake --help-policy CMP0075” for policy
details. ;Use the cmake_policy command to set the policy and suppress this
warning.;

;CMAKE_REQUIRED_LIBRARIES is set to:

; /usr/lib/x86_64-linux-gnu/librt.so

;For compatibility with CMake 3.11 and below this check is ignoring it.
Call Stack (most recent call first):
/usr/share/cmake-3.13/Modules/CheckIncludeFile.cmake:70 (message)
src/libbson/CMakeLists.txt:91 (CHECK_INCLUDE_FILE)
This warning is for project developers. Use -Wno-dev to suppress it.

– Looking for strings.h - found
– Looking for strlcpy
– Looking for strlcpy - not found
– Looking for clock_gettime
– Looking for clock_gettime - found
– Looking for strnlen
– Looking for strnlen - found
– Looking for stdbool.h
– Looking for stdbool.h - found
– Looking for SYS_gettid
– Looking for SYS_gettid - found
– Looking for syscall
– Looking for syscall - found
– Performing Test HAVE_ATOMIC_32_ADD_AND_FETCH
– Performing Test HAVE_ATOMIC_32_ADD_AND_FETCH - Success
– Performing Test HAVE_ATOMIC_64_ADD_AND_FETCH
– Performing Test HAVE_ATOMIC_64_ADD_AND_FETCH - Success
– Looking for pthread.h
– Looking for pthread.h - found
– Looking for pthread_create
– Looking for pthread_create - not found
– Check if compiler accepts -pthread
– Check if compiler accepts -pthread - yes
– Found Threads: TRUE
Adding -fPIC to compilation of bson_static components
libmongoc version (from VERSION_CURRENT file): 1.17.2
– Searching for zlib CMake packages
– Found ZLIB: /usr/lib/x86_64-linux-gnu/libz.so (found version “1.2.11”)
– zlib found version “1.2.11”
– zlib include path “/usr/include”
– zlib libraries “/usr/lib/x86_64-linux-gnu/libz.so”
– Looking for include file unistd.h
– Looking for include file unistd.h - found
– Looking for include file stdarg.h
– Looking for include file stdarg.h - found
– Searching for compression library zstd
– Found PkgConfig: /usr/bin/pkg-config (found version “0.29.1”)
– Checking for module ‘libzstd’
– No package ‘libzstd’ found
– Not found
– Found OpenSSL: /usr/lib/x86_64-linux-gnu/libcrypto.so (found version “1.1.1b”)
– Looking for ASN1_STRING_get0_data in /usr/lib/x86_64-linux-gnu/libcrypto.so
– Looking for ASN1_STRING_get0_data in /usr/lib/x86_64-linux-gnu/libcrypto.so - found
– Searching for sasl/sasl.h
– Not found (specify -DCMAKE_INCLUDE_PATH=/path/to/sasl/include for SASL support)
– Searching for libsasl2
– Not found (specify -DCMAKE_LIBRARY_PATH=/path/to/sasl/lib for SASL support)
– Check size of socklen_t
– Check size of socklen_t - done
– Looking for res_nsearch
– Looking for res_nsearch - found
– Looking for res_ndestroy
– Looking for res_ndestroy - not found
– Looking for res_nclose
– Looking for res_nclose - found
– Looking for sched_getcpu
– Looking for sched_getcpu - not found
– Detected parameters: accept (int, struct sockaddr *, socklen_t *)
– Searching for compression library header snappy-c.h
– Not found (specify -DCMAKE_INCLUDE_PATH=/path/to/snappy/include for Snappy compression)
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 - Success
– Compiling against OpenSSL
– SASL disabled
Adding -fPIC to compilation of mongoc_static components
– Building with MONGODB-AWS auth support
– Build files generated for:
– build system: Unix Makefiles
– Configuring done
– Generating done
– Build files have been written to: /home/chris/mongo/mongo-c-driver-1.17.2/cmake-build

cd …/…/mongo-cxx-driver-r3.6.1/build
chris@nuc8i7:~/mongo/mongo-cxx-driver-r3.6.1/build$ cmake … -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=~/mongo/mongo-c-driver-1.17.2/cmake-build -DCMAKE_INSTALL_PREFIX=~/mongo/mongo-c-driver-1.17.2/cmake-build
– The CXX compiler identification is GNU 8.3.0
– Check for working CXX compiler: /usr/bin/c++
– Check for working CXX compiler: /usr/bin/c++ – works
– Detecting CXX compiler ABI info
– Detecting CXX compiler ABI info - done
– Detecting CXX compile features
– Detecting CXX compile features - done
– The C compiler identification is GNU 8.3.0
– Check for working C compiler: /usr/bin/cc
– Check for working C compiler: /usr/bin/cc – works
– Detecting C compiler ABI info
– Detecting C compiler ABI info - done
– Detecting C compile features
– Detecting C compile features - done
– Auto-configuring bsoncxx to use MNMLSTC for polyfills since C++17 is inactive
bsoncxx version: 3.6.1
CMake Error at src/bsoncxx/CMakeLists.txt:113 (find_package):
By not providing “Findlibbson-1.0.cmake” in CMAKE_MODULE_PATH this project
has asked CMake to find a package configuration file provided by
“libbson-1.0”, but CMake did not find one.

Could not find a package configuration file provided by “libbson-1.0”
(requested version 1.13.0) with any of the following names:

libbson-1.0Config.cmake
libbson-1.0-config.cmake

Add the installation prefix of “libbson-1.0” to CMAKE_PREFIX_PATH or set
“libbson-1.0_DIR” to a directory containing one of the above files. If
“libbson-1.0” provides a separate development package or SDK, be sure it
has been installed.

– Configuring incomplete, errors occurred!
See also “/home/chris/mongo/mongo-cxx-driver-r3.6.1/build/CMakeFiles/CMakeOutput.log”.

You only provided the output for the CMake configure commands. Without the output of the C driver installation it is still not possible to determine the precise issue. However, on my own system, the installation goes into /usr/local by default:

Install the project...
-- Install configuration: "RelWithDebInfo"
-- Installing: /usr/local/share/mongo-c-driver/COPYING
-- Installing: /usr/local/share/mongo-c-driver/NEWS

Can you confirm that to the case? If it is, then the -DCMAKE_PREFIX_PATH= option is unneeded. Additionally, specifying -DCMAKE_INSTALL_PREFIX=~/mongo/mongo-c-driver-1.17.2/cmake-build tells CMake you want the C++ driver to be installed to the same directory where you built the C driver. You probably do not want this.

In any event, if your CMake defaults to installing somewhere other than /usr/local/ you will need to adjust the -DCMAKE_PREFIX_PATH= option to the C++ driver build to match. If it is installing to /usr/local/, then you may have some other environmental issue that is causing CMake to no longer search /usr/local/lib as it should by default.

Feel free to provide the output of the C driver installation step if you still need assistance to determine where the components are being installed.

cd mongo-c-driver-1.17.2
mkdir cmake-build
cd cmake-build
cmake .. -DENABLE_AUTOMATIC_INIT_AND_CLEANUP=OFF -DCMAKE_INSTALL_PREFIX=~/mongo/mongoc
-- The C compiler identification is ;GNU 4.8.5
-- Check for working C compiler: /bin/cc
-- Check for working C compiler: /bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- No CMAKE_BUILD_TYPE selected, defaulting to RelWithDebInfo
-- Build and install static libraries
-- Check if the system is big endian
-- Searching 16 bit integer
-- 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 unsigned short
-- Check size of unsigned short - done
-- Using unsigned short
-- Check if the system is big endian - little endian
-- Looking for snprintf
-- Looking for snprintf - found
-- Looking for reallocf
-- Looking for reallocf - not found
-- Performing Test BSON_HAVE_TIMESPEC
-- Performing Test BSON_HAVE_TIMESPEC - Success
--     struct timespec found
-- Looking for gmtime_r
-- Looking for gmtime_r - found
-- Looking for rand_r
-- Looking for rand_r - found
-- Looking for strings.h
-- Looking for strings.h - found
-- Looking for strlcpy
-- Looking for strlcpy - not found
-- Looking for clock_gettime
-- Looking for clock_gettime - found
-- Looking for strnlen
-- Looking for strnlen - found
-- Looking for stdbool.h
-- Looking for stdbool.h - found
-- Looking for SYS_gettid
-- Looking for SYS_gettid - found
-- Looking for syscall
-- Looking for syscall - found
-- Performing Test HAVE_ATOMIC_32_ADD_AND_FETCH
-- Performing Test HAVE_ATOMIC_32_ADD_AND_FETCH - Success
-- Performing Test HAVE_ATOMIC_64_ADD_AND_FETCH
-- Performing Test HAVE_ATOMIC_64_ADD_AND_FETCH - Success
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Check if compiler accepts -pthread
-- Check if compiler accepts -pthread - yes
-- Found Threads: TRUE
-- Searching for zlib CMake packages
-- Found ZLIB: /usr/lib64/libz.so (found version "1.2.7")
-- Looking for include file unistd.h
-- Looking for include file unistd.h - found
-- Looking for include file stdarg.h
-- Looking for include file stdarg.h - found
-- Searching for compression library zstd
-- Found PkgConfig: /bin/pkg-config (found version "0.27.1")
-- Checking for module 'libzstd'
--   No package 'libzstd' found
--   Not found
-- Found OpenSSL: /usr/lib64/libcrypto.so (found version "1.0.2k")
-- Looking for ASN1_STRING_get0_data in /usr/lib64/libcrypto.so
-- Looking for ASN1_STRING_get0_data in /usr/lib64/libcrypto.so - not found
-- Searching for sasl/sasl.h
--   Not found (specify -DCMAKE_INCLUDE_PATH=/path/to/sasl/include for SASL support)
-- Searching for libsasl2
--   Not found (specify -DCMAKE_LIBRARY_PATH=/path/to/sasl/lib for SASL support)
-- Check size of socklen_t
-- Check size of socklen_t - done
-- Looking for res_nsearch
-- Looking for res_nsearch - found
-- Looking for res_ndestroy
-- Looking for res_ndestroy - not found
-- Looking for res_nclose
-- Looking for res_nclose - found
-- Looking for sched_getcpu
-- Looking for sched_getcpu - not found
-- Detected parameters: accept (int, struct sockaddr *, socklen_t *)
-- Searching for compression library header snappy-c.h
--   Not found (specify -DCMAKE_INCLUDE_PATH=/path/to/snappy/include for Snappy compression)
-- No ICU library found, SASLPrep disabled for SCRAM-SHA-256 authentication.
-- If ICU is installed in a non-standard directory, define ICU_ROOT as the ICU installation path.
-- libmongocrypt not found. Configuring without Client-Side Field Level Encryption support.
-- Performing Test MONGOC_HAVE_SS_FAMILY
-- Performing Test MONGOC_HAVE_SS_FAMILY - Success
-- Compiling against OpenSSL
-- SASL disabled
-- Building with MONGODB-AWS auth support
-- Build files generated for:
--      build system: Unix Makefiles
-- Configuring done
-- Generating done
-- Build files have been written to: /home/ux1/net/mongo/mongo-c-driver-1.17.2/cmake-build
make install
[  6%] Built target bson_shared
[  6%] Built target bcon-speed
[ 11%] Built target bson_static
[ 12%] Built target json-to-bson
[ 12%] Built target bson-streaming-reader
[ 13%] Built target bson-to-json
[ 13%] Built target bson-metrics
[ 13%] Built target bson-validate
[ 14%] Built target bcon-col-view
[ 15%] Built target bson-check-depth
[ 39%] Built target mongoc_shared
[ 40%] Built target common-operations
[ 40%] Built target bulk6
[ 40%] Built target bulk4
[ 40%] Built target bulk3
[ 40%] Built target bulk1
[ 41%] Built target bulk-collation
[ 41%] Built target basic-aggregation
[ 42%] Built target bulk2
[ 42%] Built target mongoc-dump
[ 42%] Built target hello_mongoc
[ 43%] Built target find-and-modify
[ 43%] Built target example-resume
[ 66%] Built target mongoc_static
[ 66%] Built target test-mongoc-cache
[ 66%] Built target aggregation1
[ 67%] Built target test-mongoc-gssapi
[ 68%] Built target example-scram
[ 69%] Built target mongoc-stat
[ 70%] Built target example-command-monitoring
[ 70%] Built target example-collection-watch
[ 70%] Built target fam
[ 95%] Built target test-libmongoc
[ 95%] Built target mongoc-ping
[ 95%] Built target example-sdam-monitoring
[ 95%] Built target example-command-with-opts
[ 96%] Built target bulk5
[ 97%] Built target example-create-indexes
[ 97%] Built target mongoc-tail
[ 97%] Built target example-pool
[ 97%] Built target example-start-at-optime
[ 97%] Built target example-gridfs
[ 98%] Built target example-session
[ 98%] Built target example-client
[ 99%] Built target example-gridfs-bucket
[100%] Built target example-transaction
[100%] Built target example-update
Install the project...
-- Install configuration: "RelWithDebInfo"
-- Installing: /home/ux1/net/mongo/mongoc/share/mongo-c-driver/COPYING
-- Installing: /home/ux1/net/mongo/mongoc/share/mongo-c-driver/NEWS
-- Installing: /home/ux1/net/mongo/mongoc/share/mongo-c-driver/README.rst
-- Installing: /home/ux1/net/mongo/mongoc/share/mongo-c-driver/THIRD_PARTY_NOTICES
-- Installing: /home/ux1/net/mongo/mongoc/lib64/libbson-1.0.so.0.0.0
-- Installing: /home/ux1/net/mongo/mongoc/lib64/libbson-1.0.so.0
-- Installing: /home/ux1/net/mongo/mongoc/lib64/libbson-1.0.so
-- Installing: /home/ux1/net/mongo/mongoc/lib64/libbson-static-1.0.a
-- Installing: /home/ux1/net/mongo/mongoc/include/libbson-1.0/bson/bson-config.h
-- Installing: /home/ux1/net/mongo/mongoc/include/libbson-1.0/bson/bson-version.h
-- Installing: /home/ux1/net/mongo/mongoc/include/libbson-1.0/bson/bcon.h
-- Installing: /home/ux1/net/mongo/mongoc/include/libbson-1.0/bson/bson-atomic.h
-- Installing: /home/ux1/net/mongo/mongoc/include/libbson-1.0/bson/bson-clock.h
-- Installing: /home/ux1/net/mongo/mongoc/include/libbson-1.0/bson/bson-compat.h
-- Installing: /home/ux1/net/mongo/mongoc/include/libbson-1.0/bson/bson-context.h
-- Installing: /home/ux1/net/mongo/mongoc/include/libbson-1.0/bson/bson-decimal128.h
-- Installing: /home/ux1/net/mongo/mongoc/include/libbson-1.0/bson/bson-endian.h
-- Installing: /home/ux1/net/mongo/mongoc/include/libbson-1.0/bson/bson-error.h
-- Installing: /home/ux1/net/mongo/mongoc/include/libbson-1.0/bson/bson.h
-- Installing: /home/ux1/net/mongo/mongoc/include/libbson-1.0/bson/bson-iter.h
-- Installing: /home/ux1/net/mongo/mongoc/include/libbson-1.0/bson/bson-json.h
-- Installing: /home/ux1/net/mongo/mongoc/include/libbson-1.0/bson/bson-keys.h
-- Installing: /home/ux1/net/mongo/mongoc/include/libbson-1.0/bson/bson-macros.h
-- Installing: /home/ux1/net/mongo/mongoc/include/libbson-1.0/bson/bson-md5.h
-- Installing: /home/ux1/net/mongo/mongoc/include/libbson-1.0/bson/bson-memory.h
-- Installing: /home/ux1/net/mongo/mongoc/include/libbson-1.0/bson/bson-oid.h
-- Installing: /home/ux1/net/mongo/mongoc/include/libbson-1.0/bson/bson-prelude.h
-- Installing: /home/ux1/net/mongo/mongoc/include/libbson-1.0/bson/bson-reader.h
-- Installing: /home/ux1/net/mongo/mongoc/include/libbson-1.0/bson/bson-string.h
-- Installing: /home/ux1/net/mongo/mongoc/include/libbson-1.0/bson/bson-types.h
-- Installing: /home/ux1/net/mongo/mongoc/include/libbson-1.0/bson/bson-utf8.h
-- Installing: /home/ux1/net/mongo/mongoc/include/libbson-1.0/bson/bson-value.h
-- Installing: /home/ux1/net/mongo/mongoc/include/libbson-1.0/bson/bson-version-functions.h
-- Installing: /home/ux1/net/mongo/mongoc/include/libbson-1.0/bson/bson-writer.h
-- Installing: /home/ux1/net/mongo/mongoc/include/libbson-1.0/bson.h
-- Installing: /home/ux1/net/mongo/mongoc/lib64/pkgconfig/libbson-1.0.pc
-- Installing: /home/ux1/net/mongo/mongoc/lib64/pkgconfig/libbson-static-1.0.pc
-- Installing: /home/ux1/net/mongo/mongoc/lib64/cmake/bson-1.0/bson-targets.cmake
-- Installing: /home/ux1/net/mongo/mongoc/lib64/cmake/bson-1.0/bson-targets-relwithdebinfo.cmake
-- Installing: /home/ux1/net/mongo/mongoc/lib64/cmake/bson-1.0/bson-1.0-config.cmake
-- Installing: /home/ux1/net/mongo/mongoc/lib64/cmake/bson-1.0/bson-1.0-config-version.cmake
-- Installing: /home/ux1/net/mongo/mongoc/lib64/cmake/libbson-1.0/libbson-1.0-config.cmake
-- Installing: /home/ux1/net/mongo/mongoc/lib64/cmake/libbson-1.0/libbson-1.0-config-version.cmake
-- Installing: /home/ux1/net/mongo/mongoc/lib64/cmake/libbson-static-1.0/libbson-static-1.0-config.cmake
-- Installing: /home/ux1/net/mongo/mongoc/lib64/cmake/libbson-static-1.0/libbson-static-1.0-config-version.cmake
-- Installing: /home/ux1/net/mongo/mongoc/bin/mongoc-stat
-- Installing: /home/ux1/net/mongo/mongoc/lib64/libmongoc-1.0.so.0.0.0
-- Installing: /home/ux1/net/mongo/mongoc/lib64/libmongoc-1.0.so.0
-- Set runtime path of "/home/ux1/net/mongo/mongoc/lib64/libmongoc-1.0.so.0.0.0" to ""
-- Installing: /home/ux1/net/mongo/mongoc/lib64/libmongoc-1.0.so
-- Installing: /home/ux1/net/mongo/mongoc/lib64/libmongoc-static-1.0.a
-- Installing: /home/ux1/net/mongo/mongoc/include/libmongoc-1.0/mongoc/mongoc-config.h
-- Installing: /home/ux1/net/mongo/mongoc/include/libmongoc-1.0/mongoc/mongoc-version.h
-- Installing: /home/ux1/net/mongo/mongoc/include/libmongoc-1.0/mongoc/mongoc.h
-- Installing: /home/ux1/net/mongo/mongoc/include/libmongoc-1.0/mongoc/mongoc-apm.h
-- Installing: /home/ux1/net/mongo/mongoc/include/libmongoc-1.0/mongoc/mongoc-bulk-operation.h
-- Installing: /home/ux1/net/mongo/mongoc/include/libmongoc-1.0/mongoc/mongoc-change-stream.h
-- Installing: /home/ux1/net/mongo/mongoc/include/libmongoc-1.0/mongoc/mongoc-client.h
-- Installing: /home/ux1/net/mongo/mongoc/include/libmongoc-1.0/mongoc/mongoc-client-pool.h
-- Installing: /home/ux1/net/mongo/mongoc/include/libmongoc-1.0/mongoc/mongoc-client-side-encryption.h
-- Installing: /home/ux1/net/mongo/mongoc/include/libmongoc-1.0/mongoc/mongoc-collection.h
-- Installing: /home/ux1/net/mongo/mongoc/include/libmongoc-1.0/mongoc/mongoc-cursor.h
-- Installing: /home/ux1/net/mongo/mongoc/include/libmongoc-1.0/mongoc/mongoc-database.h
-- Installing: /home/ux1/net/mongo/mongoc/include/libmongoc-1.0/mongoc/mongoc-error.h
-- Installing: /home/ux1/net/mongo/mongoc/include/libmongoc-1.0/mongoc/mongoc-flags.h
-- Installing: /home/ux1/net/mongo/mongoc/include/libmongoc-1.0/mongoc/mongoc-find-and-modify.h
-- Installing: /home/ux1/net/mongo/mongoc/include/libmongoc-1.0/mongoc/mongoc-gridfs.h
-- Installing: /home/ux1/net/mongo/mongoc/include/libmongoc-1.0/mongoc/mongoc-gridfs-bucket.h
-- Installing: /home/ux1/net/mongo/mongoc/include/libmongoc-1.0/mongoc/mongoc-gridfs-file.h
-- Installing: /home/ux1/net/mongo/mongoc/include/libmongoc-1.0/mongoc/mongoc-gridfs-file-page.h
-- Installing: /home/ux1/net/mongo/mongoc/include/libmongoc-1.0/mongoc/mongoc-gridfs-file-list.h
-- Installing: /home/ux1/net/mongo/mongoc/include/libmongoc-1.0/mongoc/mongoc-handshake.h
-- Installing: /home/ux1/net/mongo/mongoc/include/libmongoc-1.0/mongoc/mongoc-host-list.h
-- Installing: /home/ux1/net/mongo/mongoc/include/libmongoc-1.0/mongoc/mongoc-init.h
-- Installing: /home/ux1/net/mongo/mongoc/include/libmongoc-1.0/mongoc/mongoc-index.h
-- Installing: /home/ux1/net/mongo/mongoc/include/libmongoc-1.0/mongoc/mongoc-iovec.h
-- Installing: /home/ux1/net/mongo/mongoc/include/libmongoc-1.0/mongoc/mongoc-log.h
-- Installing: /home/ux1/net/mongo/mongoc/include/libmongoc-1.0/mongoc/mongoc-macros.h
-- Installing: /home/ux1/net/mongo/mongoc/include/libmongoc-1.0/mongoc/mongoc-matcher.h
-- Installing: /home/ux1/net/mongo/mongoc/include/libmongoc-1.0/mongoc/mongoc-opcode.h
-- Installing: /home/ux1/net/mongo/mongoc/include/libmongoc-1.0/mongoc/mongoc-prelude.h
-- Installing: /home/ux1/net/mongo/mongoc/include/libmongoc-1.0/mongoc/mongoc-read-concern.h
-- Installing: /home/ux1/net/mongo/mongoc/include/libmongoc-1.0/mongoc/mongoc-read-prefs.h
-- Installing: /home/ux1/net/mongo/mongoc/include/libmongoc-1.0/mongoc/mongoc-server-description.h
-- Installing: /home/ux1/net/mongo/mongoc/include/libmongoc-1.0/mongoc/mongoc-client-session.h
-- Installing: /home/ux1/net/mongo/mongoc/include/libmongoc-1.0/mongoc/mongoc-socket.h
-- Installing: /home/ux1/net/mongo/mongoc/include/libmongoc-1.0/mongoc/mongoc-stream-tls-libressl.h
-- Installing: /home/ux1/net/mongo/mongoc/include/libmongoc-1.0/mongoc/mongoc-stream-tls-openssl.h
-- Installing: /home/ux1/net/mongo/mongoc/include/libmongoc-1.0/mongoc/mongoc-stream.h
-- Installing: /home/ux1/net/mongo/mongoc/include/libmongoc-1.0/mongoc/mongoc-stream-buffered.h
-- Installing: /home/ux1/net/mongo/mongoc/include/libmongoc-1.0/mongoc/mongoc-stream-file.h
-- Installing: /home/ux1/net/mongo/mongoc/include/libmongoc-1.0/mongoc/mongoc-stream-gridfs.h
-- Installing: /home/ux1/net/mongo/mongoc/include/libmongoc-1.0/mongoc/mongoc-stream-socket.h
-- Installing: /home/ux1/net/mongo/mongoc/include/libmongoc-1.0/mongoc/mongoc-topology-description.h
-- Installing: /home/ux1/net/mongo/mongoc/include/libmongoc-1.0/mongoc/mongoc-uri.h
-- Installing: /home/ux1/net/mongo/mongoc/include/libmongoc-1.0/mongoc/mongoc-version-functions.h
-- Installing: /home/ux1/net/mongo/mongoc/include/libmongoc-1.0/mongoc/mongoc-write-concern.h
-- Installing: /home/ux1/net/mongo/mongoc/include/libmongoc-1.0/mongoc/mongoc-rand.h
-- Installing: /home/ux1/net/mongo/mongoc/include/libmongoc-1.0/mongoc/mongoc-stream-tls.h
-- Installing: /home/ux1/net/mongo/mongoc/include/libmongoc-1.0/mongoc/mongoc-ssl.h
-- Installing: /home/ux1/net/mongo/mongoc/include/libmongoc-1.0/mongoc.h
-- Installing: /home/ux1/net/mongo/mongoc/lib64/pkgconfig/libmongoc-1.0.pc
-- Installing: /home/ux1/net/mongo/mongoc/lib64/pkgconfig/libmongoc-static-1.0.pc
-- Installing: /home/ux1/net/mongo/mongoc/lib64/pkgconfig/libmongoc-ssl-1.0.pc
-- Installing: /home/ux1/net/mongo/mongoc/lib64/cmake/mongoc-1.0/mongoc-targets.cmake
-- Installing: /home/ux1/net/mongo/mongoc/lib64/cmake/mongoc-1.0/mongoc-targets-relwithdebinfo.cmake
-- Installing: /home/ux1/net/mongo/mongoc/lib64/cmake/mongoc-1.0/mongoc-1.0-config.cmake
-- Installing: /home/ux1/net/mongo/mongoc/lib64/cmake/mongoc-1.0/mongoc-1.0-config-version.cmake
-- Installing: /home/ux1/net/mongo/mongoc/lib64/cmake/libmongoc-1.0/libmongoc-1.0-config.cmake
-- Installing: /home/ux1/net/mongo/mongoc/lib64/cmake/libmongoc-1.0/libmongoc-1.0-config-version.cmake
-- Installing: /home/ux1/net/mongo/mongoc/lib64/cmake/libmongoc-static-1.0/libmongoc-static-1.0-config.cmake
-- Installing: /home/ux1/net/mongo/mongoc/lib64/cmake/libmongoc-static-1.0/libmongoc-static-1.0-config-version.cmake
-- Installing: /home/ux1/net/mongo/mongoc/share/mongo-c-driver/uninstall.sh

the C compile and install is above

Based on the additional output, you need to pass -DCMAKE_PREFIX_PATH=~/mongo/mongoc to the C++ Driver CMake command.

it’s attempting to download EP_mnmlstc_core, but Ithe machine I am building it on doesn’t have internet access. Why does it need EP_mnmlstc_core, and how can I get it so I can copy it across manually?

I am not sure why your posts are delayed in becoming visible. As far as the MNMLSTC project, it provides the c++17 polyfill. You can choose from other options (“Step 2” in the installation guide. For reference, the Debian and Ubuntu packages use the -DBSONCXX_POLY_USE_BOOST=1 option to avoid triggering the MNMLSTC download during the build.

If you keep deleting your posts it will make resolving the problem more difficult. That said, based on the GCC 4.8.5 version, it looks like you are running on RHEL 7.0 (or a clone). Where did you obtain the Boost 1.58 packages? Can you provide the source so that I can try to replicate the failure you encountered?

Hi, I deleted the post because I resolved the issue by upgrading to the latest boost, however I can confirm that boost 1.58 doesn’t work, I got it from Boost Version History

The mongo-cxx-driver-r3.6.1 examples fail to compile:

/mongo-cxx-driver-r3.6.1/examples/projects/mongocxx/cmake/static$ build.sh

  • BUILD_TYPE=Release
  • CXX_STANDARD=11
  • CMAKE=cmake
  • rm -rf ‘build/*’
  • cd build
  • ‘[’ -z ‘’ ‘]’
  • cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_STANDARD=11 …
    CMake Error at CMakeLists.txt:71 (get_target_property):
    get_target_property() called with non-existent target
    “mongo::bsoncxx_static”.

CMake Error at CMakeLists.txt:74 (message):
Expected BSONCXX_STATIC to be defined

– Configuring incomplete, errors occurred!

OK. Thanks for the information. I will investigate and try to replicate the error.

1 Like

what should BSONCXX_STATIC be set to?

The examples are massively confusing - they have deep nested directory structure with multiple cmake files, and there is no README on how to build them. Is it possible to provide a hello world with a makefile?

Any chance you got it working? Im running into the same issue and i dont really know where to go from here.

Hi @Luke_Colias,

I noticed you started a topic with details specific to your install challenges: C++ Driver libbson-1.0 build error on CentOS 8. If you can provide the additional details requested on that topic (and also include your specific O/S version), someone may be able to provide suggestions relevant to your environment.

There’s a related discussion topic with some suggestions which might be helpful for you: Simple c++ example - #2 by wan.

@wan created a Docker image which sets up a working development environment including a code example:

Even if you don’t intend to use Docker, it can be useful to have a working environment to compare against one you are trying to configure. The get-started-cxx Docker image uses Ubuntu 20.04.

Regards,
Stennie

I am not able to use BOOST since mongo only works with the latest version of boost which clashes with our existing version.
Therefore I need cmake to work with a local version of EP_mnmlstc_core. Please can you advise the changes I need to make to the cmake files to pick up a local version rather than download during cmake.
Also, where can I download EP_mnmlstc_core?

Thank you for the reply, I’m using centOS 8 as my operating system which is a red-hat variant I believe. I’ll take a look at this post though and try to compare his configuration to mine still though!