Linux에서 c언어 개발 중,


make는 완료 했으나

실행 중에 .so(공유 library)를 못 찾는 경우 다음과 같이 해결하면 된다.

(이 때, 에러메시지:  cannot open shared object file - no such file or directory)



(UBUNTU)

1. /etc/ld.so.conf.d/  밑에  myApp.conf 파일 추가

2. myApp.conf 파일 첫 줄에

  /usr/lib/myApp/lib  과 같이 특정한 위치 지정    

3. sudo ldconfig (Reload임)



(Debian)

1. /etc/ld.so.conf 편집

2. 마지막 줄에 /usr/lib/myApp/lib 과 같은 특정한 위치 추가

3. ldconfig (Reload임)    (조회는 ldconfig -v)



참조: http://blog.andrewbeacock.com/2007/10/how-to-add-shared-libraries-to-linuxs.html 



또다른 간단한 방법으로는

run 쉘스크립트를 하나 만드는 것이다.


#!/bin/bash

LD_LIBRARY_PATH=/home/myid/common/lib:$LD_LIBRARY_PATH

export LD_LIBRARY_PATH

./test_program

Posted by yongary
,