[英]Application running on Iinux OS (custom board) does not reads the shared libraries from the exported LD_LIBRARY_PATH
I am trying to run an application ( a.out
), very small application contains only one print statement) on Linux OS custom board which is not having the shared libs in /lib
or /usr/lib
. 我正在尝试在Linux OS定制板上运行一个应用程序(
a.out
,一个非常小的应用程序仅包含一个打印语句),而该Linux OS定制板上在/lib
或/usr/lib
没有共享库。
So I am exporting the shared libs path using LD_LIBRARY_PATH
所以我正在使用
LD_LIBRARY_PATH
导出共享库路径
export LD_LIBRARY_PATH=/media/opensourcelib/toolchainLib/ramfslib
I made sure, shared libraries are in this path /media/opensourcelib/toolchainLib/ramfslib
我确定共享库在此路径中
/media/opensourcelib/toolchainLib/ramfslib
Still, after this, when I execute a.out
I get the error 仍然,在此之后,当我执行
a.out
我得到了错误
/bin/sh: ./../usr/lib/a.out: not found
If I copy my shared libs to /lib
, the application works fine. 如果我将共享库复制到
/lib
,则该应用程序可以正常运行。
But I need to make it work without copying the shared libs. 但是我需要使其工作而不复制共享库。 Please help me, what could be the issue in exporting
LD_LIBRARY_PATH
. 请帮助我,导出
LD_LIBRARY_PATH
可能是什么问题。
I would do the following things: 我会做以下事情:
ls /media/opensourcelib/toolchainLib/ramfslib
, before any other thing, and check that the library is there. ls /media/opensourcelib/toolchainLib/ramfslib
,然后检查该库是否存在。 ldconfig
. ldconfig
的事情之一。 Maybe for your libmylib.so.1.5.8
you will find the links libmylib.so.1.5
, libmylib.so.1
and libmylib.so
. libmylib.so.1.5.8
您会找到链接libmylib.so.1.5
, libmylib.so.1
和libmylib.so
。 ldd a.out
. ldd a.out
检查库依赖关系。 strace
installed into the system (if not, I recommend to compile it for your board and copy it to your board), try to launch it exporting previously LD_LIBRARY_PATH
and verify the paths are tried to read (and a many other things). strace
安装到系统中(如果未安装,则建议为您的开发板进行编译并将其复制到您的开发板中),尝试导出以前的LD_LIBRARY_PATH
来启动它,并验证是否尝试读取路径(以及许多其他操作) 。 I hope it could be helpful. 希望对您有所帮助。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.