在Solaris上,我可以使用crle命令配置库路径,如下所示:
crle -c /var/ld/ld.config -l /lib:/usr/lib:/usr/local/lib:/opt/DSI/32我还可以使用传统的LD_LIBRARY_PATH方法,如:
LD_LIBRARY_PATH="/export/home/donald/mysql-5.0.91-installed/lib/mysql/:/lib:/usr/lib"Solaris是如何决定库路径的?例如,Solaris是否首先从crle path中选择,然后从LD_LIBRARY_PATH中进行选择?我试着google,但找不到答案。
发布于 2014-11-03 08:43:56
答案在手册(ManL.D.so.1)中。
The runtime linker uses a prescribed search path for locat-
ing the dynamic dependencies of an object. The default
search paths are the runpath recorded in the object, fol-
lowed by a series of defaults. For 32-bit objects, the
defaults are /lib followed by /usr/lib. For 64-bit objects,
the defaults are /lib/64 followed by /usr/lib/64. These
defaults component can be modified using a configuration
file that is created with crle(1). The runpath is specified
when the dynamic object is constructed using the -R option
to ld(1). The environment variable LD_LIBRARY_PATH can be
used to indicate directories to be searched before the
default directories.因此,命令是:
LD_LIBRARY_PATHcrle默认值https://stackoverflow.com/questions/26710440
复制相似问题