MongoC installation CMake Error

114 views
Skip to first unread message

Ingrid Santana

unread,
Aug 9, 2018, 1:33:13 PM8/9/18
to mongodb-user
I'm installing MongoC on Google Cloud Plataform and I get this error:


ingrid@instance-1:~/mongo-c-driver-1.6.3/cmake-build$ cmake -DENABLE_AUTOMATIC_INIT_AND_CLEANUP=OFF ..
-- Searching for sasl/sasl.h
--   Found in /usr/include
-- Searching for libsasl2
--   Found /usr/lib/x86_64-linux-gnu/libsasl2.so
-- Detected parameters: accept (int, struct sockaddr *, socklen_t *)
Current version (from VERSION_CURRENT file): 1.6.3
-- Compiling against Cyrus SASL
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
BSON
    linked by target "mongoc_shared" in directory /home/ingrid/mongo-c-driver-1.6.3
    linked by target "mongoc_static" in directory /home/ingrid/mongo-c-driver-1.6.3
-- Configuring incomplete, errors occurred!
See also "/home/ingrid/mongo-c-driver-1.6.3/cmake-build/CMakeFiles/CMakeOutput.log".
See also "/home/ingrid/mongo-c-driver-1.6.3/cmake-build/CMakeFiles/CMakeError.log".

What can be the cause? There is something left to install? I really want this MongoC version (1.6.3) not the most recent one.

A. Jesse Jiryu Davis

unread,
Aug 10, 2018, 5:45:19 PM8/10/18
to mongodb-user
Hi! In C Driver versions before 1.9.0, you had to install libbson and libmongoc as two separate steps using CMake. Try something like the following:

cd mongo-c-driver-1.6.3\src\libbson
cmake .
make && sudo make install # build and install libbson
cd ../..
cmake .
make && sudo make install # build and install libmongoc

If you don't want to install in the systemwide /usr/local, then try something like:

cd mongo-c-driver-1.6.3\src\libbson
cmake -DCMAKE_PREFIX_PATH=/my/path -DCMAKE_INSTALL_PREFIX=/my/path .
make && sudo make install # build and install libbson
cd ../..
cmake -DCMAKE_PREFIX_PATH=/my/path -DCMAKE_INSTALL_PREFIX=/my/path .
make && sudo make install # build and install libmongoc

Can you tell me why you don't want to use the latest driver?

Ingrid Santana

unread,
Aug 10, 2018, 5:55:36 PM8/10/18
to mongodb-user
It worked!!! Thank you very much!!!
I don't want to change because I need to re-run a project I build when 1.6.3 was the most recent one and I know I use functions that don't exist anymore or are different. Updating those functions to the newer version of them would require more time than I have available
Reply all
Reply to author
Forward
0 new messages