问题描述
是否可以通过编程方式找出dlopen()为共享对象搜索的路径?我一直以为dlopen()只会出现在/lib和/usr/lib中,但是现在我已经看到在Linux Mint上,几个核心组件(如libglib-2.0.so)位于完全不同的文件夹中,即/rofs/lib/中.i386-gnu-linux和其他一些.有没有办法了解dlopen()将搜索共享对象的所有这些路径?我已经检查了环境变量LD_LIBRARY_PATH,但是根本没有定义.
is there a way to find out programmatically which paths are searched by dlopen() for shared objects? I always thought dlopen() would only look in /lib and /usr/lib but now I've seen that on Linux Mint several core components like libglib-2.0.so are in a wholly different folders, namely in /rofs/lib/i386-gnu-linux and some others. Is there a way to get to know all these paths that dlopen() will search through for a shared object? I already checked the environment variable LD_LIBRARY_PATH but it's not defined at all.
推荐答案
查看 ldconfig
手册页和文件:/etc/ld.so.conf
这篇关于dlopen()搜索路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!