Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 01-01-2005, 01:42 PM   #1
LQ Newbie
Registered: Nov 2004
Posts: 27

Rep: Reputation: 15
including usr/local/lib directory

Hi i am new to linux and i am using Fedora core 2.

I am currently using an API called jrtplib. However when i install it , it install all the library files to a /usr/local/lib . Unfortunatley the the g++ compiler i am using ( not sure which version ) doesnt check that directory when searching for errors ,, so of course a whole lot of "undefined reference errors " arise at compile time .

What i want to know if what modification needs to be made to allow the compiler or whatever is responsible for the aspect , so as to force it too check the usr/local/lib directory rather than onlyt the usr/lib directory.

thanx in Advance, Quest
Old 01-01-2005, 01:53 PM   #2
Senior Member
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,290

Rep: Reputation: 378Reputation: 378Reputation: 378Reputation: 378
Add /usr/local/lib to your LD_LIBRARY_PATH environment variable, i.e.

export LD_LIBRARY_PATH=/usr/local/lib

Edit /etc/ to make the change permanent and visible accross users.
Old 01-01-2005, 03:11 PM   #3
Senior Member
Registered: Jan 2002
Location: Nanjing, China
Distribution: Ubuntu 20.04
Posts: 2,099

Rep: Reputation: 73
That doesn't work. I did it. You will have to change your bash or other shell profile. Sorry btmiller, but I had the same advice, from you or someone and it didn't work. It won't stay exported
Old 01-01-2005, 05:13 PM   #4
Senior Member
Registered: Dec 2004
Distribution: Slackware, ROCK
Posts: 1,973

Rep: Reputation: 46
To make LD_LIBRARY_PATH stay permanent, You have to add it to /etc/profile (system wide) or ~/.bashrc(for user only).
when you add an entry to /etc/ you *MUST* run /sbin/ldconfig (as root) for it to take permanent effect. ldconfig rebuilds the /etc/ file and the /usr/local/lib files will be searched for by the linker. Generally, LD_LIBRARY_PATH is not the best way to go as it is often misused.

When exporting environment variables, like LD_LIBRARY_PATH the following:

export LD_LIBRARY_PATH=/usr/local/lib

sets LD_LIBRARY_PATH only to usr/local/lib - so if the system had say /opt/whatever/lib in its LD_LIBRARY_PATH that would be gone after the above command.

Instead use LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH - this sets /usr/local/lib as the first directory LD_LIBRARY_PATH searches and doesn't disturb anything that was previously in its path.

alternatively, export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib set /usr/local/lib as the last directory it searches without disturbing the rest of the path.

But, the right way to do it is add /usr/local/lib to /etc/ and run /sbin/ldconfig and that will correct
your problem.

By the way, if you want to see what ldconfig is finding, run (as root) 'ldconfig -v | more' and you can see exactly what libraries it is finding.

Last edited by __J; 01-01-2005 at 05:15 PM.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Starting httpd: /usr/sbin/httpd: symbol lookup error: /usr/local/lib/ bijuhpd Linux - Newbie 1 10-30-2005 06:07 PM
cannot configure: permission denial in '/usr/local/lib/' sophiatang Red Hat 1 09-01-2005 09:29 PM
Installing software, /usr/lib directory and /usr/local millertime Linux - Software 2 07-10-2004 10:21 AM
/usr/lib and /usr/local/lib doxxan Slackware 5 06-15-2004 01:58 AM
no php.ini file under /usr/local/lib/ !! jogurt666 Linux - Software 1 12-16-2003 01:06 AM > Forums > Linux Forums > Linux - Software

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

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration