: undefined reference to `mysql_connect’

linux technology

gcc -o mysqlclient mysqlclient.c  -L /usr/lib/mysql/ -lmysqlclient -lz
/tmp/ccllX580.o(.text+0x40): In function `main':
: undefined reference to `mysql_connect'

mysql_connect is old news.

I am writing a mysql client in C. Since it has been a while I am googling for simple templates, and only found an ancient one at first. Google likes old pages.
Then I found this example chapter of the Mysql book by Dubois. I read it, it’s great. The best book I know on the matter. By leaps and bounds better than the O’Reilley one.
Anyhow. I think there was a source CD. Maybe not. Wouldn’t it be great if you get the example code and reference material online. Of course people might not buy the book then. Simple solution: Print on every page little and subtle line numbers. The web site serving the source code would ask occassionally: “please enter the seond work of line 45 on page 315”. If you get it right you get a couple of more page views. Mildly annoying, but better than looking for the CD.
Actually you could put the entire book online like this.

A Book also makes a pretty good dongle.