List:General Discussion« Previous MessageNext Message »
From:Ray Yous Date:April 5 1999 6:07pm
Subject:[MySQL] linker prolblem
View as plain text  
Originator: none
Organization: home
MySQL support: none
Synopsis: serious
Severity: serious
Priority: medium
Category: mysql C API's
Class: linker troublbe to lib files
Release: mysql-3.21.33b


System: FreeBSD 4.X
Architecture: Intel hardware I guess which the ISP may be using
Some paths:
             header files   /usr/local/include/mysql
             Lib files      /usr/local/lib/mysql
gcc version


   I have been have this problem for a while now and I have asked this 
question before but I can't get past this problem.  I have looked though 
the archives but no answer.  The onl;y information related to my problem 
in the mySQL manual is about adding the math lib to help linking and but 
no help.
   I am trying to get just connection help to mysql through a C program 
using C API's but I get the same error in the linking process.  


$ gcc -I/usr/local/include/mysql program.c -L/usr/local/lib/mysql 
-lmysqlclient -o program
/var/tmp/ccXW16381.o: Undefined symbol `_mysql_init' referenced from 
text segment



int main()
  MYSQL *mysql;



   Why can't it find the function in its own lib files "mysql_init"?  
Could the lib files be corrupted or the headers.  Or am I just to new to 
this and can't figure it out.  I am sorry to bother you guys and that 
you get this question a lot, but I have searched a lot and can't find 
resouce to help me.  

P.S. Thank you earlier Thimble Smith, but I am still in the problem.

Thank you,

When linking with the C API, the following errors may occur on some 

gcc -g -o client test.o -L/usr/local/lib/mysql -lmysqlclient -lsocket 

Undefined        first referenced
 symbol          in file
floor            /usr/local/lib/mysql/libmysqlclient.a(password.o)
ld: fatal: Symbol referencing errors. No output written to client

If this happens on your system, you must include the math library by 
adding -lm to the end of the
compile/link line. 
Get Your Private, Free Email at
[MySQL] linker prolblemRay Yous5 Apr
  • Re: [MySQL] linker prolblemCharles Kirby5 Apr
  • [MySQL] linker prolblemMichael Widenius6 Apr