编译与DLZ" / usr / bin / ld绑定时出现CentOS错误:找不到-lmysqlclient"

时间:2017-03-30 05:00:53

标签: mysql makefile compilation centos bind

所以我试图在CentOS 7上用DLZ(mysql)支持编译Bind

完成后

 ./configure --prefix=/usr --sysconfdir=/etc/bind --localstatedir=/var --mandir=/usr/share/man --infodir=/usr/share/info --enable-threads --enable-largefile --with-libtool --enable-shared --enable-static --with-openssl=/usr --with-gssapi=/usr --with-gnu-ld --with-dlz-postgres=no --with-dlz-mysql=yes --with-dlz-bdb=no --with-dlz-filesystem=yes  --with-dlz-stub=yes --enable-ipv6

make

我收到错误:

 /opt/bind/bind-9.11.0-P3/lib/isc/.libs/libisc.so ../../lib/isc/.libs/libisc.so -lcrypto -L/usr/lib/mysql -lmysqlclient -lcrypt -lm -ldl -lz -lpthread
 /usr/bin/ld: cannot find -lmysqlclient
 collect2: error: ld returned 1 exit status
 make[2]: *** [named] Error 1
 make[2]: Leaving directory `/opt/bind/bind-9.11.0-P3/bin/named'
 make[1]: *** [subdirs] Error 1
 make[1]: Leaving directory `/opt/bind/bind-9.11.0-P3/bin'
 make: *** [subdirs] Error 1

我已经让它在一个CentOS 7盒子上工作,但是我试图让它工作时安装了各种各样的东西。我实际上并不知道为什么它会在那台机器上编译,我希望能够复制这个过程。所以我创建了一个全新的CentOS 7安装程序,并试着找出如何使用DLZ支持编译Bind。绑定9.11.0-P3。

我安装了mariadb-libs,/ usr / lib64 / mysql目录看起来像这样。

ll /usr/lib64/mysql/ total 16884 -rw-r--r--. 1 root root 2687 Nov 14 15:15 INFO_BIN -rw-r--r--. 1 root root 170 Sep 12 2016 INFO_SRC lrwxrwxrwx. 1 root root 17 Mar 29 16:40 libmysqlclient_r.so -> libmysqlclient.so lrwxrwxrwx. 1 root root 20 Mar 29 16:40 libmysqlclient.so -> libmysqlclient.so.18 lrwxrwxrwx. 1 root root 24 Mar 29 16:40 libmysqlclient.so.18 -> libmysqlclient.so.18.0.0 -rwxr-xr-x. 1 root root 3135736 Nov 14 15:17 libmysqlclient.so.18.0.0 lrwxrwxrwx. 1 root root 15 Mar 29 16:40 libmysqld.so -> libmysqld.so.18 -rwxr-xr-x. 1 root root 14116296 Nov 14 15:17 libmysqld.so.18 -rwxr-xr-x. 1 root root 10474 Nov 14 15:14 mysqlbug -rwxr-xr-x. 1 root root 6758 Nov 14 15:15 mysql_config drwxr-xr-x. 2 root root 4096 Mar 29 16:40 plugin

/ usr / lib / mysql目录如下所示。

ll /usr/lib/mysql/ total 0 drwxr-xr-x. 2 root root 6 Mar 29 21:36 plugin

在/ usr / lib / mysql文件夹上的Bind Compiles看起来不同的机器上,当我在其他机器上提供yum时,我得到了这个结果:

yum whatprovides /usr/lib/mysql/libmysqlclient.so.18.0.0 Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * base: centos.mirror.ca.planethoster.net * extras: centos.mirror.ca.planethoster.net * updates: mirror.it.ubc.ca * webtatic: us-east.repo.webtatic.com 1:mariadb-libs-5.5.52-1.el7.i686 : The shared libraries required for MariaDB/MySQL clients Repo : base Matched from: Filename : /usr/lib/mysql/libmysqlclient.so.18.0.0 1:mariadb-libs-5.5.52-1.el7.x86_64 : The shared libraries required for MariaDB/MySQL clients Repo : @base Matched from: Filename : /usr/lib/mysql/libmysqlclient.so.18.0.0

在全新安装中,我安装了这些mariadb软件包。

yum list mariadb*
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirror.its.sfu.ca
 * extras: centos.bhs.mirrors.ovh.net
 * updates: mirror.its.sfu.ca
Installed Packages
mariadb.x86_64                               1:5.5.52-1.el7                @base
mariadb-bench.x86_64                         1:5.5.52-1.el7                @base
mariadb-devel.x86_64                         1:5.5.52-1.el7                @base
mariadb-embedded.x86_64                      1:5.5.52-1.el7                @base
mariadb-embedded-devel.x86_64                1:5.5.52-1.el7                @base
mariadb-libs.x86_64                          1:5.5.52-1.el7                @base
mariadb-server.x86_64                        1:5.5.52-1.el7                @base
mariadb-test.x86_64                          1:5.5.52-1.el7                @base
Available Packages

请帮我弄清楚如何在CentOS 7上安装Bind with DLZ支持!

1 个答案:

答案 0 :(得分:0)

添加'LDFLAGS =“ - I / usr / include / mysql -L / usr / lib64 / mysql”' 转到./configure命令

喜欢这样

  

./ configure --prefix = / usr --sysconfdir = / etc / bind --localstatedir = / var --mandir = / usr / share / man --infodir = / usr / share / info --enable- threads --enable-largefile --with-libtool --enable-shared --enable-static --with-openssl = / usr --with-gssapi = / usr --with-gnu-ld --with-dlz- postgres = no --with-dlz-mysql = yes --with-dlz-bdb = no --with-dlz-filesystem = yes --with-dlz-stub = yes --enable-ipv6 LDFLAGS =“ - I / usr / include / mysql -L / usr / lib64 / mysql“