title: SQLite3 - Cannot Open Database
body: <p>I have the following code:</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;string&gt;
  #include "sqlite3.h"
  int main()
  {
  
      sqlite3* db;
      int rc = sqlite3_open("testing.db",  &amp;db);
      std::cout &lt;&lt; rc &lt;&lt; std::endl;
      std::cout &lt;&lt; sqlite3_errmsg(db);
      std::cin &gt;&gt; rc;
  }
  </code></pre>
  
  <p>When I run it, the program outputs "21" and "library routine called out of sequence". What am I doing wrong? 21 is the code for SQLITE_MISUSE. See: <a href="http://www.sqlite.org/c3ref/c_abort.html" rel="nofollow noreferrer">http://www.sqlite.org/c3ref/c_abort.html</a></p>