On Tue, Apr 16, 2002 at 06:34:56PM -0500, Tom Whiting wrote:
> This may seem like an apparent newbie question, and if it does I'm
> sorry. I've spent the past couple of hours trying to figure out how to
> actually get a mysql connection running on the game. Sadly it compiles,
> up untill where the object files are linked in, then spits out the
> following:
> 
> /home/twhiting/beta/src/sql_stats.c:93: undefined reference to
> `mysql_escape_string'
> 
> In mysql/mysql.h, I've found the refs to mysql_close and all.
> 
> In the makefile:
> LIBS    = -lcrypt -lmysqlclient -lnsl -lnisam -lmysys -s
> 
> When it comes to linking in libraries, I've got zero experience
> whatsoever. Can anyone see what I'm doing wrong in here? I'm stumped.

Order matters.  I don't know what the mysys or nisam is for ....  is
that where the msyql code is?  If so, then move mysqlclient AFTER them
in the link line.

(ie, the linker is one pass... if it loads mysqlclient, sees no symbols
it needs, then loads, say, mysys, it's too late for it to go back and
grab things from mysqlclient).


Reply via email to