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

Posted on 2007-08-09
Last Modified: 2013-11-05

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 ->
-rwxr-xr-x  1 root root 211004 Feb 21  2005
lrwxrwxrwx  1 root root     24 Aug  8 11:28 ->
-rwxr-xr-x  1 root root 207488 Feb 21  2005
[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 ->
-rwxr-xr-x  1 root root 211004 Feb 21  2005
lrwxrwxrwx  1 root root     24 Aug  8 11:28 ->
-rwxr-xr-x  1 root root 207488 Feb 21  2005
[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?

Question by:zattz
    LVL 26

    Accepted Solution

    since you say the libs are in the /usr/lib folder, try this:

    ./configure --with-includes=/usr --with-libraries=/usr
    LVL 34

    Assisted Solution

    by:Duncan Roe
    In /usr/lib, ln -s
    while you're at it, you might as well ln -s
    You need the bare .so at build time (that's what ld looks for)
    LVL 43

    Expert Comment

    You need to install mysql-devel package
    up2date mysql-devel

    Author Comment

    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

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    What Is Threat Intelligence?

    Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

    If you have a server on collocation with the super-fast CPU, that doesn't mean that you get it running at full power. Here is a preamble. When doing inventory of Linux servers, that I'm administering, I've found that some of them are running on l…
    Setting up Secure Ubuntu server on VMware 1.      Insert the Ubuntu Server distribution CD or attach the ISO of the CD which is in the “Datastore”. Note that it is important to install the x64 edition on servers, not the X86 editions. 2.      Power on th…
    Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
    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…

    737 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

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now