Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 04-07-2008, 07:44 AM   #1
LQ Newbie
Registered: Mar 2008
Posts: 12

Rep: Reputation: 0
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!

Old 04-07-2008, 12:12 PM   #2
LQ Addict
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian stable
Posts: 5,908

Rep: Reputation: 356Reputation: 356Reputation: 356Reputation: 356
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
Old 04-07-2008, 01:27 PM   #3
LQ Guru
Registered: Feb 2003
Location: Mineral, Virginia
Distribution: Debian 8
Posts: 7,893

Rep: Reputation: 339Reputation: 339Reputation: 339Reputation: 339
Originally Posted by jenser2 View Post

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


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
gcc-libraries yashwantpinge Programming 3 11-22-2005 12:17 AM
GCC-3.3.4 C++ & Depreciated libraries aes canis Programming 3 05-12-2005 06:12 AM
intaling GCC-3.3.3. in chroot env FAILS tests xtrem Linux From Scratch 1 02-18-2005 12:24 PM
downgrading gcc and other libraries on FC3 kernelnayyer Fedora 1 02-14-2005 09:49 PM
C libraries with GCC compiler Ciccio Programming 2 12-02-2002 11:20 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:52 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