Rick,

The error suggests that libmysqlclient is not in /usr/local/lib/mysql.
the -L must refer to the directory containing libmysqlclient.a for the
compile to succeed.

John Lodge

-----Original Message-----
From: Rick Runowski [mailto:[EMAIL PROTECTED]]
Sent: Monday, February 18, 2002 11:18 PM
To: [EMAIL PROTECTED]
Subject: Newbie alert!



All,

I am having difficulty compiling a piece of software.  If I try compiling
with the following:

gcc dnd.cpp -o dnd3 -L /usr/local/lib/mysql -lmysqlclient

as suggested in "Core MySQL by Leon Atkinson" on page 436, I get the
error:

/usr/bin/ld:  cannot find -lmysqlclient
collect2: ld returned 1 exit status

As an experiment I tried

g++ dnd.cpp -o dnd3

and my compiler belched up the following:

/tmp/cco2LOOc.o: In function "mon_list(void):
/tmp/cco2LOOc.o(.text+0x872): undefined reference to 'mysql_init'
/tmp/cco2LOOc.o(.text+0x89e): undefined reference to 'mysql_real_connect'
/tmp/cco2LOOc.o(.text+0x8b2): undefined reference to 'mysql_error'

etc.

I think it lists every mysql command I used.  I have copied the code
almost directly out of the book (changing server name, user name, and
table name).  

I am running Red Hat 7.1 and I have checked that the header files are
there.  Any suggestions?

Thank you,
Rick


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail
<[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to