How do I get rid of LD_LIBRARY_PATH at run-time?

后端 未结 7 1152
温柔的废话
温柔的废话 2021-02-14 10:25

I am building a C++ application that uses Intel\'s IPP library. This library is installed by default in /opt and requires you to set LD_LIBRARY_PATH both for compil

7条回答
  •  故里飘歌
    2021-02-14 11:07

    You should use the -R option if possible.

    If not, rename your executable and create a launch script that runs your executable, and in there set LD_LIBRARY_PATH just for that scope.

    Depending on platform, you can modify ld.so.conf via /etc/ld.so.conf.d (Redhat/Fedora come to mind) which makes deploying changes to ld.so "easier" from a deployment scenario.

提交回复
热议问题