I would like to install the new update of the MongoDB-C driver but it seems that the compilation logically blocks while including the libbson library (#include <bson.h>
) previously installed in the directory "/usr/local/".
How to "link" my libraries correctly in order to use both #include <bson.h>
and #include <mongoc.h>
?
Both
libmongoc
andlibbson
are automake-based projects now (./configure, make, make install). They additionally install pkg-config *.pc files that can be used to discover library installation and header paths using thepkg-config
program. If you have installed to /usr/local, you might need to set PKG_CONFIG_PATH=/usr/local/lib/pkg-config (or lib64) depending if your system automatically includes that path.A simple way to build against them is to do:
If you are in a Makefile, you'll need to shell out first. When using GNU make I typically do: