How can I compile the Mongodb-c-driver program?
The path /usr/local/lib
should be in /etc/ld.so.conf
or in one of the files in /etc/ld.so.conf.d/
directory. So the library mongoc
will get into the cache when you issue command ldconfig
as root.
You can check if library mongoc
is in dynamic linker cache by executing this command
ldconfig -p | grep mongoc
If it is you are safe to run your program without explicitly specifying LD_LIBRARY_PATH.
Other way to check if your executable is correctly linked is by getting the linking information with ldd
command. It will print all linked libraries.
ldd mongotest
If you can see /usr/local/lib/libmongoc.so.[numbers]
that means it is linked with mongoc
library.