Why doesn't LD_LIBRARY_PATH has any effect?

6,367

You might need to run sudo ldconfig /usr/local/lib to update the dynamic linker cache. Otherwise I think the system doesn't know which libraries are available from that directory. See man ldconfig for more info.

Share:
6,367

Related videos on Youtube

nlognfan
Author by

nlognfan

Updated on September 18, 2022

Comments

  • nlognfan
    nlognfan over 1 year

    ./a.out: error while loading shared libraries: libc++.so.1: cannot open shared object file: No such file or directory

    even though:

    $ echo $LD_LIBRARY_PATH
    /home/exe/libcxx/lib:/home/exe/llvm/lib:/usr/local/lib
    $ ls /usr/local/lib
    libc++.so  libc++.so.1  libc++.so.1.0  python2.7  python3.2
    

    I even copied it next to the executable, still no effect.

    What am I doing wrong?

  • nlognfan
    nlognfan almost 11 years
    It works. Do I have to repeat it after every reboot?
  • Paul
    Paul almost 11 years
    No, it should update /etc/ld.so.cache permanently. You should only need to re-run if you add or remove libraries in that directory again (normally apt-get handles this step for you for packaged libraries under /usr).