Shared Libraries in Same Folder with App in TCSH

耗尽温柔 提交于 2019-12-06 13:41:34

问题


I am deploying a locally-compiled app to a remote Linux server. Since I don't have root account I cannot put needed shared libraries to /usr/lib Is there a way to overcome this? I put libraries in same folder and changed "path" variable but did not work.


回答1:


Two simple options.

  1. You can set the LD_LIBRARY_PATH variable inside your script (see Section 3.3.1. of the shared libraries HOWTO). There are problems with this approach for production code, but if set in a wrapper script is probably ok.
  2. You can call your app with the libraries specified on the command line by invoking the ld-linux program loader directly, as described in the manpage and HOWTO:

    /lib/ld-linux.so.2 --library-path PATH EXECUTABLE



来源:https://stackoverflow.com/questions/1437393/shared-libraries-in-same-folder-with-app-in-tcsh

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!