|
发表于 2004-7-17 09:34:26
|
显示全部楼层
看看manpage是如何说的:
dlopen loads a dynamic library from the file named by the null termi-
nated string filename and returns an opaque "handle" for the dynamic
library. If filename is not an absolute path (i.e., it does not begin
with a "/"), then the file is searched for in the following locations:
A colon-separated list of directories in the user's
LD_LIBRARY_PATH environment variable.
The list of libraries cached in /etc/ld.so.cache.
/lib, followed by /usr/lib.
If filename is a NULL pointer, then the returned handle is for the main program.
如果是你自己用绝对路径打开动态库,你自己当然知道。如果不是这样,按照/etc/ld.so.conf中指定的路径,然后是/lib, /usr/lib的顺序搜索就能找到。不过编程时可能麻烦了一些。 |
|