Step 1 : Run the Following Command:

wget https://github.com/mongodb/mongo-c-driver/releases/download/1.6.3/mongo-c-driver-1.6.3.tar.gz
tar xzf mongo-c-driver-1.6.3.tar.gz
cd mongo-c-driver-1.6.3
./configure --disable-automatic-init-and-cleanup --prefix=/usr/local --libdir=/usr/lib64 --with-libbson=bundled
make
make install

Step 2 : To compile and run the program use following command:

gcc -o filename filename.c $(pkg-config --libs --cflags libmongoc-1.0)

Issues:

1. $(pkg-config –libs –cflags libmongoc-1.0) , this command in above command is link libmongoc-1 ,without this #include<bson.h> not be detected.

2. If Compiler cannot recognize the header function in program 1. Then Match your function with Header function and there parameter and type.

One thought on “Installing the Mongodb-C Driver (libmongoc) and BSON library (libbson)”

Leave a Reply