[Solved] Shared library fetching fails if LD_LIBRARY_PATH isn’t exported

Antonio Santoro Asks: Shared library fetching fails if LD_LIBRARY_PATH isn’t exported
By looking at /etc/ld.so.conf.d there is a libc.conf file that point to /usr/local/lib that contains the .so file necessary to run my application correctly. Even running ldconfig -v it is showed that the above path is set yet when I launch my program it fails to run the library contained in there. I must export LD_LIBRARY_PATH="/usr/local/lib" in order to correctly execute it but I need it to be set every time a new shell is open, so I tried to add the environment variable either to /etc/environment or /home/user/.profile or even /home/user/.bashrc without any success.

What’s the correct way to set that variable permanently and why it is failing to pick the library even though a .conf file is pointing to the correct path?

EDIT:

ldd /usr/local/lib

Code:
asant@ANTONIO-PC:~$ ldd /usr/local/lib/libsqlcipher.so
        linux-vdso.so.1 (0x00007fff25d9e000)
        libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f133d2f2000)
        libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f133d2cf000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f133d0dd000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f133d6c5000)
asant@ANTONIO-PC:~$ ldd /usr/local/lib/libsqlcipher.so.0
        linux-vdso.so.1 (0x00007ffcaede4000)
        libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f02bb35d000)
        libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f02bb33a000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f02bb148000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f02bb730000)
asant@ANTONIO-PC:~$ ldd /usr/local/lib/libsqlcipher.so.0.8.6
        linux-vdso.so.1 (0x00007ffe7daa7000)
        libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007ff66585b000)
        libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007ff665838000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007ff665646000)
        /lib64/ld-linux-x86-64.so.2 (0x00007ff665c2e000)

Ten-tools.com may not be responsible for the answers or solutions given to any question asked by the users. All Answers or responses are user generated answers and we do not have proof of its validity or correctness. Please vote for the answer that helped you in order to help others find out which is the most helpful answer. Questions labeled as solved may be solved or may not be solved depending on the type of question and the date posted for some posts may be scheduled to be deleted periodically. Do not hesitate to share your response here to help other visitors like you. Thank you, Ten-tools.