title: Linking sqlite.lib in a Visual C++ project
body: <p>I am following this <a href="https://dcravey.wordpress.com/2011/03/21/using-sqlite-in-a-visual-c-application/" rel="nofollow">tutorial</a> to start using SQLite in a Visual C++ App.</p>
  
  <p>But I've created a Windows Forms Application instead.</p>
  
  <p>I added this code in my <code>main</code> function:</p>
  
  <pre><code>sqlite3 *dbb;
  char *zErrMsg;
  int rc;
  
  rc = sqlite3_open("test.db", &amp;dbb);
  </code></pre>
  
  <p>And I get the following errors:</p>
  
  <pre><code>Error   2   error LNK2031: unable to generate p/invoke for "extern "C" int __clrcall sqlite3_open(char const *,struct sqlite3 * *)" (?sqlite3_open@@$$J0YMHPBDPAPAUsqlite3@@@Z); calling convention missing in metadata D:\Info\visual studio\bProject\bProject\bProject.obj
  Warning 3   warning LNK4248: unresolved typeref token (01000027) for 'sqlite3'; image may not run   D:\Info\visual studio\bProject\bProject\bProject.obj
  Error   4   error LNK2028: unresolved token (0A00001B) "extern "C" int __clrcall sqlite3_open(char const *,struct sqlite3 * *)" (?sqlite3_open@@$$J0YMHPBDPAPAUsqlite3@@@Z) referenced in function "int __clrcall main(cli::array&lt;class System::String ^ &gt;^)" (?main@@$$HYMHP$01AP$AAVString@System@@@Z)    D:\Info\visual studio\bProject\bProject\bProject.obj
  Error   5   error LNK2019: unresolved external symbol "extern "C" int __clrcall sqlite3_open(char const *,struct sqlite3 * *)" (?sqlite3_open@@$$J0YMHPBDPAPAUsqlite3@@@Z) referenced in function "int __clrcall main(cli::array&lt;class System::String ^ &gt;^)" (?main@@$$HYMHP$01AP$AAVString@System@@@Z) D:\Info\visual studio\bProject\bProject\bProject.obj
  Error   6   error LNK1120: 2 unresolved externals   D:\Info\visual studio\bProject\Debug\bProject.exe
  </code></pre>
  
  <p>I searched for about few hours to see what it means and how can I resolve them, but I found only that the library may not be linked correctly ...</p>
  
  <p>Any ideas ?</p>