LD_LIBRARY_PATH  : 라이브러리가 있는 곳을 명시해 주는 환경변수

ex) export LD_LIBRARY_PATH=/usr/my/lib:$LD_LIBRARY_PATH


p.s. : 라이브러리가 있는 곳을 명시해주는 파일 : /etc/ld.so.conf

ex) cat /usr/my/lib >> /etc/ld.so.conf




원문 : http://kldp.org/node/71409


LD_LIBRARY_PATH가 설정되지 않아도 됩니다.
그럴경우에 라이브러리를 검색하는 디렉토리는 /etc/ld.so.conf에 있는 디렉토리와 /usr/lib, /lib 순이 됩니다.

$ man ld.so

LD.SO(8) LD.SO(8)

NAME
ld.so/ld-linux.so - dynamic linker/loader

DESCRIPTION
ld.so loads the shared libraries needed by a program, prepares the pro?
gram to run, and then runs it. Unless explicitly specified via the
-static option to ld during compilation, all Linux programs are incom?
plete and require further linking at run time.

The necessary shared libraries needed by the program are searched for
in the following order

o Using the environment variable LD_LIBRARY_PATH
(LD_AOUT_LIBRARY_PATH for a.out programs). Except if the exe?
cutable is a setuid/setgid binary, in which case it is ignored.

o From the cache file /etc/ld.so.cache which contains a compiled
list of candidate libraries previously found in the augmented
library path.

o In the default path /usr/lib, and then /lib.





WRITTEN BY
RootFriend
개인적으로... 나쁜 기억력에 도움되라고 만들게되었습니다.

,