LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   setting lib paths (https://www.linuxquestions.org/questions/linux-software-2/setting-lib-paths-469173/)

Moebius 07-30-2006 02:36 PM

setting lib paths
 
I compiled my application successfully, but now when I try to run it, it says it requires libOgreMain.so.11 to run, which is correct, but the lib is already in /usr/local/lib. How can I make sure the programs looks there? Is there something for libs equivilant to the $PATH env variable for binaries? If I were lazy i could copy the required libs into the run dir, but what is the proper way of going about this problem?

ciotog 07-30-2006 02:52 PM

There should be an entry for /usr/local/lib in /etc/ld.so.conf, check as follows:
Code:

cat /etc/ld.so.conf | grep /usr/local/lib
If this returns a line, it's there. If not, it should be added then run ldconfig.

You also might need to set PKG_CONFIG_PATH, but that's for compiling.

Moebius 07-30-2006 02:56 PM

Hmm the only three lines are:

$ cat /etc/ld.so.conf
/lib32
/usr/lib32
/usr/X11R6/lib32

Does ubuntu handle it differently somehow? I can't imagine my system would function at all if /usr/lib and /usr/local/lib were supposed to be in there, but this is the only app that currently has this problem.

AdaHacker 07-30-2006 08:48 PM

Quote:

Originally Posted by Moebius
Is there something for libs equivilant to the $PATH env variable for binaries?

Yes, it's called LD_LIBRARY_PATH.

Moebius 07-30-2006 08:50 PM

Quote:

Originally Posted by AdaHacker
Yes, it's called LD_LIBRARY_PATH.

Hmmm what does it mean if that is blank?

reddazz 07-30-2006 09:04 PM

Follow the instructions posted by ciotog (post 2) and your apps will also search for libs in /usr/local/lib.

AdaHacker 07-31-2006 06:15 AM

Quote:

Originally Posted by Moebius
Hmmm what does it mean if that is blank?

Absolutely nothing. Typically, the dynamic linker will look in /lib and /usr/lib without having to be told anything. Other common locations for libraries are normally added to /etc/ld.so.conf. LD_LIBRARY_PATH is typically used for ad hoc cases like installing a library in your home directory. It's not supposed to have a default value.


All times are GMT -5. The time now is 02:43 AM.