Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

GCC & MYSQL: "/usr/bin/ld: cannot find -lmysqlclient"

Status
Not open for further replies.

cadbilbao

Programmer
Apr 9, 2001
233
ES
Hi.

On Linux FC2 with mySQL 4.1, I'm trying to compile a very simple C
program
by using GCC, but I get this error message:

---------------------
[root@pc]# gcc -o hello -I'/usr/src/redhat/BUILD/mysql-4.1.9/include/'
-L'/usr/lib/mysql' -lmysqlclient -lz -lcrypt -lnsl -lm hello.c
/usr/bin/ld: cannot find -lmysqlclient
collect2: ld returned 1 exit status
------------------

I checked:
--------------------
[root@pc]# /sbin/ldconfig -v | grep libmysqlclient
libmysqlclient_r.so.10 -> libmysqlclient_r.so.10.0.0
libmysqlclient.so.10 -> libmysqlclient.so.10.0.0

[root@pc]# echo $LD_LIBRARY_PATH
/usr/lib/mysql:

[root@pc]# find . -name "*libmysqlclient*"
./usr/lib/mysql/libmysqlclient.so.10.0.0
./usr/lib/mysql/libmysqlclient.so.10
./usr/lib/mysql/libmysqlclient_r.so.10.0.0
./usr/lib/mysql/libmysqlclient_r.so.1
----------------------

What am I doing wrong? Regards.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top