title: SQLite3 in cygwin causing linker errors
body: <p>I'm trying to get a basic "hello world" sqlite3 program going in cygwin. I had originally installed it from the setup.exe, but when I ran the program I got linker errors such as "undefined reference to `_sqlite3_open'". I <strong>AM</strong> using the -lsqlite3 switch when compiling.</p>
  
  <p>The location is here:</p>
  
  <pre><code>$ ls /usr/lib/ | grep sql
  libsqlite3.a
  libsqlite3.dll.a
  libsqlite3.la
  </code></pre>
  
  <p>Then I tried downloading the sqlite3 source and compiling it manually, but i get the same errors. It installed to /usr/local/lib</p>
  
  <pre><code>$ ls /usr/local/lib/ | grep sql
  libsqlite3.a
  libsqlite3.dll.a
  libsqlite3.la
  </code></pre>
  
  <p>I'm still getting these linker errors though, and I can't seem to figure out how to fix it?</p>
  
  <pre><code>$ gcc -lsqlite3 test.cc
  test.cc: In function ‘int main()’:
  test.cc:41: warning: deprecated conversion from string constant to ‘char*’
  /tmp/ccKA3ZFa.o:test.cc:(.text+0x2d): undefined reference to `_sqlite3_open'
  /tmp/ccKA3ZFa.o:test.cc:(.text+0x41): undefined reference to `_sqlite3_errmsg'
  /tmp/ccKA3ZFa.o:test.cc:(.text+0xb6): undefined reference to `_sqlite3_prepare_v2'
  /tmp/ccKA3ZFa.o:test.cc:(.text+0xca): undefined reference to `_sqlite3_errmsg'
  /tmp/ccKA3ZFa.o:test.cc:(.text+0x10e): undefined reference to `_sqlite3_step'
  /tmp/ccKA3ZFa.o:test.cc:(.text+0x12a): undefined reference to `_sqlite3_column_bytes'
  /tmp/ccKA3ZFa.o:test.cc:(.text+0x140): undefined reference to `_sqlite3_column_text'
  /tmp/ccKA3ZFa.o:test.cc:(.eh_frame+0x11): undefined reference to `___gxx_personality_v0'
  collect2: ld returned 1 exit status
  </code></pre>
  
  <p>Thanks for any help you can provide. Cheers :)</p>