I can't find mongoc.h after installing Mongodb and C driver on Ubuntu 16.04.
sudo apt-get install mongodb
sudo apt-get install libmongoc-1.0-0
sudo apt-get install libbson-1.0
This is the error I get:
gcc -o mtest mtest.c -I/usr/local/include/libbson-1.0 -I/usr/local/include/libmongoc-1.0 -lmongoc-1.0 -lbson-1.0
mtest.c:1:20: fatal error: mongoc.h: No such file or directory
compilation terminated.
I checked the disk and can not find the file. Tips appreciated.
If you have installed via apt-get, then the packages almost certainly don't install to /usr/local, but to plain old /usr. What happens if you run
gcc -o mtest mtest.c -I/usr/include/libbson-1.0 -I/usr/include/libmongoc-1.0 -lmongoc-1.0 -lbson-1.0
P.S. The right way to pick up these paths is by using pkg-config instead of hard coding them, please see http://mongoc.org/libmongoc/current/tutorial.html#pkg-config
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With