3

I am using clang-9 with mysql-connector-c++8.

After mysql-connector-c++ upgrade from 1.1.12 to 8.x and running function in my app: get_driver_instance() an exception is being thrown:

"Couldn't load library libmysqlclient_r.so: libmysqlclient_r.so: cannot open shared object file"

What I've tried so far:

  • ldd on my newly compiled binary, but my newly compiled binary does not link against libmysqlclient_r.so.
  • strace -f my binary, but no info about loading this library
  • removed /etc/ld.so.cache and rebuilt it with ldconfig, than recompiled my software
  • updatedb && locate \*\.so | xargs ldd and the same for \*\.so\.\*, but no file is showing it is linked with libmysqlclient_r.so

There are no errors during compilation. I've got out of ideas what might be wrong. What might I do to diagnose it further?

DevilaN
  • 1,317
  • 10
  • 21
  • Does setting `LD_DEBUG=files` produce any clues? Also note that runtime `dlopen` calls will not produce anything in `ldd`. – Botje Apr 21 '20 at 13:14
  • @Botje: Yeah. Got: ` 5538: file=libmysqlclient_r.so [0]; dynamically loaded by /usr/lib64/libmysqlcppconn.so.7 [0]`. This .so.7 belongs to mysql-connector-c++ and it seems that this library is buggy. Tried to recompile it and my soft, but with no change. Please add your comment as an answer so I can accept it. – DevilaN Apr 21 '20 at 14:03

1 Answers1

3

Runtime dlopen calls will not produce any output in ldd, but you can convince ld.so to print when a library is loaded by whom by setting the environment variable LD_DEBUG=files.

Botje
  • 26,269
  • 3
  • 31
  • 41