ubuntu@sky:~/sqlite$ gcc sql_get_table.c
/tmp/cc6DoZtO.o: In function `main':
sql_get_table.c:(.text+0x73): undefined reference to `sqlite3_open'
sql_get_table.c:(.text+0x8a): undefined reference to `sqlite3_errmsg'
sql_get_table.c:(.text+0x165): undefined reference to `sqlite3_get_table'
sql_get_table.c:(.text+0x203): undefined reference to `sqlite3_free_table'
sql_get_table.c:(.text+0x215): undefined reference to `sqlite3_close'
collect2: ld returned 1 exit status
ubuntu@sky:~/sqlite$
ubuntu@sky:~/sqlite$ gcc -o sqlexe -L /usr/local/lib -I /usr/local/include/ -static sqlexe.c -lsqlite3
/usr/lib/gcc/i686-linux-gnu/4.6/../../../../lib/libsqlite3.a(sqlite3.o): In function `pthreadMutexTry':
(.text+0x10b6d): undefined reference to `pthread_mutex_trylock'
/usr/lib/gcc/i686-linux-gnu/4.6/../../../../lib/libsqlite3.a(sqlite3.o): In function `pthreadMutexFree':
(.text+0x10b9e): undefined reference to `pthread_mutex_destroy'
/usr/lib/gcc/i686-linux-gnu/4.6/../../../../lib/libsqlite3.a(sqlite3.o): In function `pthreadMutexAlloc':
(.text+0x10bdf): undefined reference to `pthread_mutex_init'
/usr/lib/gcc/i686-linux-gnu/4.6/../../../../lib/libsqlite3.a(sqlite3.o): In function `pthreadMutexAlloc':
(.text+0x10c13): undefined reference to `pthread_mutexattr_init'
/usr/lib/gcc/i686-linux-gnu/4.6/../../../../lib/libsqlite3.a(sqlite3.o): In function `pthreadMutexAlloc':
(.text+0x10c23): undefined reference to `pthread_mutexattr_settype'
/usr/lib/gcc/i686-linux-gnu/4.6/../../../../lib/libsqlite3.a(sqlite3.o): In function `pthreadMutexAlloc':
(.text+0x10c2f): undefined reference to `pthread_mutex_init'
/usr/lib/gcc/i686-linux-gnu/4.6/../../../../lib/libsqlite3.a(sqlite3.o): In function `pthreadMutexAlloc':
(.text+0x10c37): undefined reference to `pthread_mutexattr_destroy'
/usr/lib/gcc/i686-linux-gnu/4.6/../../../../lib/libsqlite3.a(sqlite3.o): In function `unixDlError':
(.text+0x1c1e8): undefined reference to `dlerror'
/usr/lib/gcc/i686-linux-gnu/4.6/../../../../lib/libsqlite3.a(sqlite3.o): In function `unixDlSym':
(.text+0x2334): undefined reference to `dlsym'
ubuntu@sky:~/sqlite$ gcc -o sqlexe -L /usr/local/lib -I /usr/local/include/ -static-libgfortran sqlexe.c -lsqlite3
ubuntu@sky:~/sqlite$ ls
libsqlite3-0_3.7.2-1ubuntu0.1_i386.deb sqlexe sql_get_table sqlite3_3.7.2-1ubuntu0.1_i386.deb
libsqlite3-dev_3.7.2-1ubuntu0.1_i386.deb sqlexe.c sql_get_table.c test.db