Title says it all .. I am trying to compile a C program which connects to the MySQL database server and runs a simple select query.
I am compiling on linux with following statement:

gcc -I/usr/include/mysql -L/usr/lib/mysql -lmysqlclient -g database.c -o db
I get such errors:

/home/user1/database.c:82: undefined reference to `mysql_query'
/tmp/ccZym3kC.o(.text+0x414): In function `close_Mysqlconn':
/home/user1/database.c:224: undefined reference to `mysql_close'

I have a feeling probably there something wrong with the library switches but not sure what ...... Please help