LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 04-07-2008, 08:44 AM   #1
jenser2
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*
/usr/lib/gcc:
i586-suse-linux

/usr/lib/gcc-lib:
i686-pc-linux-gnu

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!

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

Rep: Reputation: 352Reputation: 352Reputation: 352Reputation: 352
I don't use csh, but I think it's similar to bash.

To see the current value of LD_LIBRARY_PATH:
echo $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
export $LD_LIBRARY_PATH

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
export $LD_LIBRARY_PATH
 
Old 04-07-2008, 02:27 PM   #3
jailbait
LQ Guru
 
Registered: Feb 2003
Location: Blue Ridge Mountain
Distribution: Linux Mint 17, Debian 8
Posts: 7,863

Rep: Reputation: 311Reputation: 311Reputation: 311Reputation: 311
Quote:
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

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

man ldconfig

------------------
Steve Stites
 
  


Reply


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

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:38 PM.

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