List:General Discussion« Previous MessageNext Message »
From:Sasha Pachev Date:July 20 1999 5:18pm
Subject:Re: Still Trying To Link
View as plain text  
"Joshua T. McKee" wrote:
> Does anyone have any idea how to link the mysqlclient to your own
> programs? I've been trying to link this library into my program for the
> past 4 days without success. The diea is simple, however implementation
> proves very difficult.
> I'm trying to build a simple program (right now, just a connection to the
> database using mysql_real_connect), but I get the following error:
> Undefined                       first referenced
>  symbol                             in file
> mysql_real_connect                  /var/tmp/ccyvMqM_1.o
> ld: fatal: Symbol referencing errors. No output written to db
> This happens with any function I attempt to call within the clinet
> library. I've tried it on Solaris 2.6 with GCC 2.8.1 and mySQL 3.21.33b
> and RedHat Linux 6.0 with mySQL 3.22.23b with similar results. The
> following is the compile line I use:
> gcc -o db -I/usr/local/include/mysql -L/usr/local/lib/mysql -lmysqlclient
> -lnsl -lm -lsocket db.c
> I've also added the "-static" option (on the Linux as it appears to link
> dynamically by default), I've rebuilt mySQL using the "--disable-shared"
> option. I've added /usr/local/lib/mysql to "LD_LIBRARY_PATH" and
> "LD_RUN_PATH" during my program compile and that of mySQL
> luck! In short, everything I can think of, yet it still refuses to link
> this library. Is there some black magic vodoo that I need to perform?
> As this is happening on two different systems, with two different
> versions, it has to be something I'm doing wrong. Yet I cannot determine
> what it is. Any help would be very much appreciated!
> Josh

What's the output of 

ls -l /usr/local/lib/mysql


Sasha Pachev (home) (work)
Still Trying To LinkJoshua T. McKee20 Jul
  • Still Trying To Linksinisa20 Jul
  • Re: Still Trying To LinkSasha Pachev20 Jul
  • Re: Still Trying To LinkJonathan C. Webster21 Jul
Re: Still Trying To LinkJoshua T. McKee20 Jul