#4
by みえ » 8年前
DLL は Windows の用語で、Linux には存在しません。Shared Object のことだと推測すると、下記 ld.so のマニュアルに書いてある通りだと思います。/lib と /usr/lib がデフォルトのようです。
ld.so(8) - Linux manual page
http://man7.org/linux/man-pages/man8/ld.so.8.html
When resolving shared object dependencies, the dynamic linker first
inspects each dependency string to see if it contains a slash (this
can occur if a shared object pathname containing slashes was
specified at link time). If a slash is found, then the dependency
string is interpreted as a (relative or absolute) pathname, and the
shared object is loaded using that pathname.
If a shared object dependency does not contain a slash, then it is
searched for in the following order:
(中略)
o In the default path /lib, and then /usr/lib. (On some 64-bit
architectures, the default paths for 64-bit shared objects are
/lib64, and then /usr/lib64.) If the binary was linked with the
-z nodeflib linker option, this step is skipped.
オフトピック
Windows の DLL の場合は、環境変数の PATH よりも EXE と同じディレクトリにある DLL が優先されるはずです。
DLL は Windows の用語で、Linux には存在しません。Shared Object のことだと推測すると、下記 ld.so のマニュアルに書いてある通りだと思います。/lib と /usr/lib がデフォルトのようです。
ld.so(8) - Linux manual page
http://man7.org/linux/man-pages/man8/ld.so.8.html
[quote]When resolving shared object dependencies, the dynamic linker first
inspects each dependency string to see if it contains a slash (this
can occur if a shared object pathname containing slashes was
specified at link time). If a slash is found, then the dependency
string is interpreted as a (relative or absolute) pathname, and the
shared object is loaded using that pathname.
If a shared object dependency does not contain a slash, then it is
searched for in the following order:
(中略)
o In the default path /lib, and then /usr/lib. (On some 64-bit
architectures, the default paths for 64-bit shared objects are
/lib64, and then /usr/lib64.) If the binary was linked with the
-z nodeflib linker option, this step is skipped.[/quote]
[offtopic]Windows の DLL の場合は、環境変数の PATH よりも EXE と同じディレクトリにある DLL が優先されるはずです。[/offtopic]