I realize that variations of this question have been asked many times and many places in the past, but I haven’t been able to find a solution to my particular case, and I thought it might be helpful to have it discussed here in the forum, in case it be helpful to someone else in the future.
I have Rust and MariaDB installed on a CentOS 7 (desktop) system. When I try to install diesel-cli for just MySQl with the command:
# cargo install diesel_cli --no-default-features --features mysql
I get the dreaded error:
/usr/bin/ld: cannot find -lmysqlclient
The thing is, there are copies of libmysqlclient on the system. This is what happens when I do a search for them:
# find / -name *libmysqlclient* | egrep -v "gradle|tmp" /usr/lib64/libmysqlclient.so.15 /usr/lib64/libmysqlclient.so.16.0.0 /usr/lib64/libmysqlclient.so.15.0.0 /usr/lib64/libmysqlclient_r.so.16.0.0 /usr/lib64/libmysqlclient.so.16 /usr/lib64/libmysqlclient.so.18 /usr/lib64/libmysqlclient.so.18.0.0 /usr/lib64/libmysqlclient_r.so.15 /usr/lib64/libmysqlclient_r.so.15.0.0 /usr/lib64/libmysqlclient_r.so.16
Moreover, the directory where these instances of libmysqlclient are located is correctly pointed to by the mysql_config command,
# mysql_config --variable=pkglibdir /usr/lib64
which, as I understand it, is relied upon during the build of diesel-cli to locate libmysqlclient.
So, does anyone have any ideas as to why diesel-cli won’t build? Any ideas for potential solutions or ways to figure out a solution?
P.S. - In case it might be helpful, here is information about the MariaDB packages I have installed on the system:
yum list installed *mariadb* Installed Packages MariaDB-client.x86_64 10.3.13-1.el7.centos @mariadb MariaDB-common.x86_64 10.3.13-1.el7.centos @mariadb MariaDB-compat.x86_64 10.3.13-1.el7.centos @mariadb MariaDB-devel.x86_64 10.3.13-1.el7.centos @mariadb MariaDB-server.x86_64 10.3.13-1.el7.centos @mariadb