-   Linux - Newbie (
-   -   env settings and gcc libraries (

jenser2 04-07-2008 07:44 AM

env settings and gcc libraries
Hi guys,

I'm installing software which requires the LD_LIBRARY_PATH to be set to include gcc library files. First of all, how do I check what the gcc library path is? Is there an environment variable which is set on install? I tried to find it using the following:

$ ls /usr/lib/gcc*


So I'm assuming that the gcc libs are at /usr/lib/gcc and /usr/lib/gcc-lib? There must be a more elegant way of doing this, any suggestions?

My other problem is how to set the LD_LIBRARY_PATH variable. I've put this line into my .cshrc file:

setenv LD_LIBRARY_PATH /lib:/usr/lib:/usr/local/lib/:/usr/lib/gcc:/usr/lib/gcc-lib

but when I do 'env' in a shell (and yes, I'm using csh), there is no sign of the LD_LIBRARY_PATH variable until I type the same command at the command line. And if I start a new shell having entered it as a command, the new shell doesn't show the variable when I do 'env'

Any help appreciated!


bigrigdriver 04-07-2008 12:12 PM

I don't use csh, but I think it's similar to bash.

To see the current value of LD_LIBRARY_PATH:

To set the initial value of LD_LIBRARY_PATH:
setenv LD_LIBRARY_PATH=/lib:/usr/lib:/usr/local/lib/:/usr/lib/gcc:/usr/lib/gcc-lib

To add to the value of LD_LIBRARY_PATH:
setenv LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/lib:/usr/lib:/usr/local/lib/:/usr/lib/gcc:/usr/lib/gcc-lib

jailbait 04-07-2008 01:27 PM


Originally Posted by jenser2 (Post 3113431)

There must be a more elegant way of doing this, any suggestions?

Log in as root and use the ldconfig command:


ldconfig will put everything in /usr/lib on the library path. See:

man ldconfig

Steve Stites

All times are GMT -5. The time now is 11:03 PM.