Compiling Mongo c driver example program
Another way to fix this issue, at least in fedora 18, is to run the following commands
su -c "echo /usr/local/lib > /etc/ld.so.conf.d/mongoc.conf"
su -c "ldconfig"
which correctly link the libraries from mongo-c-driver.
Problems building mongo-c-driver-1.16.2 for Win64
The tutorial for building mongo-c-driver on Windows is missing the step which source should be downloaded (as the paragraphs for other platforms provide). So one might be tempted to download Source code (zip)
from the releases page. This will only get you a copy of the repository when the tag was set. But it is essential to use the mongo-c-driver-1.16.2.tar.gz
link on the releases page. Then everything should work.
How to compile C++ mongo project
You need to use -I and -L to specify where you have installed your mongo header(s) and library(ies):
g++ tutorial.cpp -I/path/to/mongo/include/ -pthread -L/path/to/libmongoclient
-lboost_thread-mt -lboost_filesystem -lboost_program_options
-lboost_system -o tutorial
Related Topics
The Fastest Way to Retrieve 16K Key-Value Pairs
Error: 'I' Does Not Name a Type with Auto
Getting Input from User Using Cin
Check Keypress in C++ on Linux
Set Breakpoint in C or C++ Code Programmatically for Gdb on Linux
Why Isn't Memcpy Guaranteed to Be Safe for Non-Pod Types
What Is This Crazy C++11 Syntax ==> Struct:Bar {} Foo {};
Format Curly Braces on Same Line in C++ VScode
What Are Consequences of Forcing Qobject as a Parent of Qwidget
Skipping Expected Characters Like Scanf() with Cin
Is There a Proper 'Ownership-In-A-Package' for 'Handles' Available
How to Simulate Printf's %P Format When Using Std::Cout
How to Implement Interfaces in C++
Macros in the Middle of a Class or Function Declaration