cannot load shared library that exists in /usr/local/lib (Fedora x64)

前端 未结 2 1737
星月不相逢
星月不相逢 2020-12-31 13:00

When attempting to run a program I just compiled successfully, I get the following error:

./src/sensors/laser_scan_producer: error while loading share

相关标签:
2条回答
  • 2020-12-31 13:34

    Thank you to @Joachim_Pileborg:

    ldconfig uses the file /etc/ld.so.conf. You can add /usr/local/lib to that file, re-run ldconfig and try again

    Doing so fixed the problem, although I find it odd that /usr/local/lib wouldn't have been checked in the natural course of things.

    0 讨论(0)
  • 2020-12-31 13:42

    I found a working solution for both /usr/local/lib and /usr/local/lib64 directories in this commit.

    First run this command as root to add those directories.

    tee /etc/ld.so.conf.d/local.conf <<EOF
    /usr/local/lib
    /usr/local/lib64
    EOF
    

    Next run as root:

    ldconfig
    
    0 讨论(0)
提交回复
热议问题