与 TCSH 中的应用程序在同一文件夹中的共享库 [英] Shared Libraries in Same Folder with App in TCSH

查看:44
本文介绍了与 TCSH 中的应用程序在同一文件夹中的共享库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在将本地编译的应用程序部署到远程Linux服务器.由于我没有root帐户,因此无法将所需的共享库放入/usr/lib有办法克服吗?我将库放在同一文件夹中,并更改了"path"变量,但没有用.

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. 您可以在脚本内设置 LD_LIBRARY_PATH 变量(请参见第3.3.1节".对于生产代码,这种方法存在问题,但是如果在包装脚本中设置可能还可以.
  2. 您可以通过调用

  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

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

这篇关于与 TCSH 中的应用程序在同一文件夹中的共享库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆