mongo_client() fail with error MONGO_CONN_ADDR_FAIL <p>I want to use mongodb c driver in my project, I'm on Windows 7 so built it with command :</p> <blockquote> <p>scons --m32 --c99</p> </blockquote> <p>My problem is I can't make the <a href="http://api.mongodb.org/c/current/tutorial.html#connecting" rel="nofollow">Connecting example</a> work :</p> <pre><code>#include &lt;stdio.h&gt; #define MONGO_HAVE_STDINT #include "mongo.h" int main() { mongo conn[1]; int status = mongo_client( conn, "127.0.0.1", 27017 ); printf("status %d, err %d", status, conn-&gt;err); mongo_destroy( conn ); return 0; } </code></pre> <p>Whether mongod is running on my machine or not, the output of executing the exe is : </p> <blockquote> <p>$ ./mongodb_example.exe status -1, err 3</p> </blockquote> <p>Error <code>3</code> <a href="http://api.mongodb.org/c/current/api/mongo_8h.html#a5e6f76bd796c89973ffb463e676237bba616d4918c05106a74cb200834ad0ec4e" rel="nofollow">corresponds</a> to MONGO_CONN_ADDR_FAIL error code (An error occured while calling getaddrinfo()).</p> <p>Any suggestion about how to connect successfully ?</p> <p><strong>Updates:</strong> </p> <ul> <li>version is <code>mongodb-mongo-c-driver-v0.8.1-0-g8f27c0f</code></li> </ul>