Search code examples
cmongodbpkg-config

Compiling C program with libmongoc-1.0


I cannot compile a program using the mongodb c driver. I am using the CodeBlocks IDE.

In Build options-> Other Compiler Options, I have: pkg-config --libs --cflags libmongoc-1.0 This produces an error: mongoc.h, no such file or directory.

The documentation shows: $(pkg-config --libs --cflags libmongoc-1.0) This produces an error if placed in Build Options -> Other Compiler Options. Error: expected ")"

Please advise.


Solution

  • I found my answer on another post, here: Problem installing Mongo C Driver on ubuntu 16.04

    Basically, you need to also install the dev package, the documentation doesn't mention that.