Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

make gives error: /usr/bin/ld: cannot find -lmysqlclient

Posted on 2007-08-09
4
Medium Priority
?
4,482 Views
Last Modified: 2013-11-05
Hi,

I am trying to install mydns. Whenever I try compile I get the following error:

gcc -g -O2 -fomit-frame-pointer -finline-functions -ffast-math -funsigned-char -o mydns alias.o axfr.o cache.o conf.o data.o db.o encode.o error.o listen.o main.o queue.o recursive.o reply.o resolve.o rr.o sort.o status.o task.o tcp.o udp.o update.o  ../../src/lib/libmydns.a ../../lib/libmydnsutil.a -L/usr/lib/mysql -lmysqlclient -L/usr/local/lib -lz -lnsl -lm
/usr/bin/ld: cannot find -lmysqlclient
collect2: ld returned 1 exit status
make[3]: *** [mydns] Error 1
make[3]: Leaving directory `/tmp/mydns-1.1.0/src/mydns'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/tmp/mydns-1.1.0/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/tmp/mydns-1.1.0'
make: *** [all] Error 2
[root@138 mydns-1.1.0]#

I see the libs in:
[root@138 lib]# cd /usr/lib
[root@138 lib]# ls mysql* -l
total 420
lrwxrwxrwx  1 root root     26 Aug  8 11:28 libmysqlclient_r.so.10 -> libmysqlclient_r.so.10.0.0
-rwxr-xr-x  1 root root 211004 Feb 21  2005 libmysqlclient_r.so.10.0.0
lrwxrwxrwx  1 root root     24 Aug  8 11:28 libmysqlclient.so.10 -> libmysqlclient.so.10.0.0
-rwxr-xr-x  1 root root 207488 Feb 21  2005 libmysqlclient.so.10.0.0
[root@138 lib]#

[root@138 mydns-1.1.0]# cd /usr
[root@138 usr]# cd lib
[root@138 lib]# cd mysql/
[root@138 mysql]# ls -l
total 420
lrwxrwxrwx  1 root root     26 Aug  8 11:28 libmysqlclient_r.so.10 -> libmysqlclient_r.so.10.0.0
-rwxr-xr-x  1 root root 211004 Feb 21  2005 libmysqlclient_r.so.10.0.0
lrwxrwxrwx  1 root root     24 Aug  8 11:28 libmysqlclient.so.10 -> libmysqlclient.so.10.0.0
-rwxr-xr-x  1 root root 207488 Feb 21  2005 libmysqlclient.so.10.0.0
[root@138 mysql]#

I tried to make clean and then ran
[root@138 mydns-1.1.0]# ./configure --with-includes=/usr/include/mysql --with-libraries=/usr/lib/mysql

but the make still gives the same error.

I am running on CentOS.

[root@138 mydns-1.1.0]# yum list installed |grep mysql
mysql.x86_64                             5.0.46-1.el4.centos    installed
mysql-devel.x86_64                       5.0.46-1.el4.centos    installed
mysql-libs.x86_64                        5.0.46-1.el4.centos    installed
mysql-server.x86_64                      5.0.46-1.el4.centos    installed
mysqlclient10.x86_64                     3.23.58-4.RHEL4.1      installed
mysqlclient10.i386                       3.23.58-4.RHEL4.1      installed
mysqlclient10-devel.x86_64               3.23.58-4.RHEL4.1      installed
php-mysql.x86_64                         5.1.6-3.el4s1.7        installed
[root@138 mydns-1.1.0]#

Can anybody help?




0
Comment
Question by:zattz
4 Comments
 
LVL 26

Accepted Solution

by:
jar3817 earned 1000 total points
ID: 19661558
since you say the libs are in the /usr/lib folder, try this:

./configure --with-includes=/usr --with-libraries=/usr
0
 
LVL 35

Assisted Solution

by:Duncan Roe
Duncan Roe earned 1000 total points
ID: 19661679
In /usr/lib, ln -s libmysqlclient.so.10.0.0 libmysqlclient.so
while you're at it, you might as well ln -s libmysqlclient_r.so.10.0.0 libmysqlclient_r.so
You need the bare .so at build time (that's what ld looks for)
0
 
LVL 43

Expert Comment

by:ravenpl
ID: 19662044
You need to install mysql-devel package
up2date mysql-devel
0
 

Author Comment

by:zattz
ID: 19662238
raven, I already had the mssql-devel package installed as per my first post.

I solved the problem by doing a --with-libs on the /usr/lib64/mysql path
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The purpose of this article is to demonstrate how we can use conditional statements using Python.
Often times it's very very easy to extend a volume on a Linux instance in AWS, but impossible to shrink it. I wanted to contribute to the experts-exchange community a way of providing a procedure that works on an AWS instance. It can also be used on…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Suggested Courses
Course of the Month10 days, 2 hours left to enroll

569 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question