I am using Slackware 14.1 x64 and when I want to run a program that is using mysql.h over C
I read the following error:
bash-4.2$ /home/normal/Proyectos/a.out
/home/normal/Proyectos/a.out: error while loading shared libraries: libmysqlclient.so.18: cannot open shared object file: No such file or directory
The program was compiled by:
$ gcc -L/usr/local/mysql/lib -lmysqlclient ctemp.c
What can I do?
ldd /home/normal/Proyectos/a.out
? – Braiam Jun 4 at 21:16find /usr/lib64 -name "libmysqlclient.so*"
? – Mohammad Etemaddar Jun 4 at 21:20root@- /h/n/Proyectos# ldd /home/normal/Proyectos/a.out linux-vdso.so.1 (0x00007fff991ff000) libmysqlclient.so.18 => not found libc.so.6 => /lib64/libc.so.6 (0x00007fbe8a66a000) /lib64/ld-linux-x86-64.so.2 (0x00007fbe8aa74000)
– user2356536 Jun 4 at 21:22/usr/local
into your system. – Faheem Mitha Jun 4 at 22:53libmysqlclient.so
in/usr/local/mysql/lib
. The trick is to either pass-Wl,-rpath=/usr/local/mysql/lib
to the linker, or add/usr/local/mysql/lib
to/etc/ld.so.conf
and runldconfig
. – lcd047 Jun 5 at 4:55