/usr/bin/ld: cannot find -lmariadb

Posted 雅冰石

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了/usr/bin/ld: cannot find -lmariadb相关的知识,希望对你有一定的参考价值。

一 问题描述

执行make编译的时候报错:

/usr/bin/ld: cannot find -lmariadb

collect2: error: ld returned 1 exit status

make[2]: *** [sysbench] Error 1

make[2]: Leaving directory `/opt/sysbench/src'

make[1]: *** [all-recursive] Error 1

make[1]: Leaving directory `/opt/sysbench/src'

make: *** [all-recursive] Error 1

二 解决办法

卸载MariaDB-devel,改装mysql-community-devel,再重新编译。

rpm -ivh mysql-community-common-5.7.36-1.el7.x86_64.rpm

rpm -ivh mysql-community-libs-5.7.36-1.el7.x86_64.rpm

rpm -ivh mysql-community-devel-5.7.36-1.el7.x86_64.rpm

下载地址:

https://repo.mysql.com/yum/mysql-5.7-community/el/7/x86_64/mysql-community-common-5.7.36-1.el7.x86_64.rpm

https://repo.mysql.com/yum/mysql-5.7-community/el/7/x86_64/mysql-community-libs-5.7.36-1.el7.x86_64.rpm

https://repo.mysql.com/yum/mysql-5.7-community/el/7/x86_64/mysql-community-devel-5.7.36-1.el7.x86_64.rpm

以上是关于/usr/bin/ld: cannot find -lmariadb的主要内容,如果未能解决你的问题,请参考以下文章

/usr/bin/ld: cannot find -lz

/usr/bin/ld: cannot find -lmariadb

/usr/bin/ld: cannot find -lmariadb

[tech][转] 解决/usr/bin/ld: cannot find -lxxx 问题

关于-static静态链接报出/usr/bin/ld: cannot find -lxxx的问题

/usr/bin/ld: cannot find -lxxx 的解决办法