title: Mongo C++ Driver: mongo/client/dbclient.h: No such file or directory
body: <p>I am trying to install the MongoDB C++ driver on my machine. I have followed the directions <a href="http://docs.mongodb.org/ecosystem/tutorial/getting-started-with-cpp-driver/" rel="nofollow">here</a>, and everything seemed to install successfully. Still, I can't seem to include the headers. Here is a simple test program:</p>
  
  <pre><code>#include &lt;cstdlib&gt;
  #include &lt;iostream&gt;
  #include "mongo/client/dbclient.h"
  
  void run() {
    mongo::DBClientConnection c;
    c.connect("localhost");
  }
  
  int main() {
    try {
      run();
      std::cout &lt;&lt; "connected ok" &lt;&lt; std::endl;
    } catch(const mongo::DBException &amp;e) {
      std::cout &lt;&lt; "caught" &lt;&lt; e.what() &lt;&lt; std::endl;
    }
  
    return EXIT_SUCCESS;
  }
  </code></pre>
  
  <p>Here are the errors I get:</p>
  
  <pre><code>g++ app/tutorial.cpp -pthread -lmongoclient -lboost_thread-mt -lboost_filesystem -lboost_program_options -lboost_system -o tutorial
  app/tutorial.cpp:3:35: error: mongo/client/dbclient.h: No such file or directory
  app/tutorial.cpp: In function ‘void run()’:
  app/tutorial.cpp:6: error: ‘mongo’ has not been declared
  app/tutorial.cpp:6: error: expected `;' before ‘c’
  app/tutorial.cpp:7: error: ‘c’ was not declared in this scope
  app/tutorial.cpp: In function ‘int main()’:
  app/tutorial.cpp:14: error: ISO C++ forbids declaration of ‘mongo’ with no type
  app/tutorial.cpp:14: error: expected `)' before ‘::’ token
  app/tutorial.cpp:14: error: expected `{' before ‘::’ token
  app/tutorial.cpp:14: error: ‘::DBException’ has not been declared
  app/tutorial.cpp:14: error: ‘e’ was not declared in this scope
  app/tutorial.cpp:14: error: expected `;' before ‘)’ token
  </code></pre>
  
  <p>Any help would be greatly appreciated. </p>