LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
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 08-13-2004, 05:26 PM   #1
z-vet
Member
 
Registered: Aug 2004
Location: Israel
Distribution: Ubuntu 10.10
Posts: 271

Rep: Reputation: 34
Need help setting right environment variables:configure scripts can't find libraries.


Hi all.
I need help with setting up right environment variables.I have a problem to understand how it works... Here are few examples:
I want to install KuickShow,it requires imlib to be installed.I installed imlib,imlib-devel and some libraries imlib depends on from rpm's but when i run ./configure it says that imlib is not found.Another example is kid3,program for editing tags in mp3's.Same thing,./configure cannot find libid3,but here it's really strange because i have EasyTag installed,i compiled it by myself and there was no problems with configure.I think it's about my PATH is not configured properly.So what i need to do when installing a new libs needed by applications,and how to set things up to get rid of these problems?
 
Old 08-13-2004, 06:32 PM   #2
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,568

Rep: Reputation: 164Reputation: 164
In ganaral, configure script needs *-devel packages and to have the library in one of the directories in LD_LIBRARY_PATH and/or /etc/ld.so.conf. If you install a library or is -devel file from RPMs, they'll go to the right directories. The only thing that may go wrong then is, IMHO, wrong version of the library (when program needs a newer one).

If you install a program/library from source, you may need the directory it is in into PATH (executable) and LD_LIBRARY_PATH (library). Note that you usually can change the directory your program will be in by using --prefix switch for configure.

Now an example. Assume you have a compiled from source library, let's say A (in /usr/local) and you're compiling a program that uses it (B). If the program compilains about missing A do the following:
export PATH=$PATH:/usr/local/bin
Now you can run programs in /usr/local/bin using their names. That's what your program probably has problems with.
Now, with library it's similar
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
What's important is to have $PATH/$LD_LIBRARY_PATH in the command. The ones above add the old content of the variable to the new one. So don't use
export PATH=/usr/local/bin
because you won't be able to run programs outside of /usr/local/bin without typing their full path.

To make the changes permanent (ehen you type the commands they work until you log out) insert them to /etc/profile. It changes the settings in the whole system and for all users.
 
Old 08-13-2004, 08:23 PM   #3
z-vet
Member
 
Registered: Aug 2004
Location: Israel
Distribution: Ubuntu 10.10
Posts: 271

Original Poster
Rep: Reputation: 34
Thanks,Mara. One more question: how exactly do i need to add these lines to /etc/profile? E.g. where,in which line? It's a script,i don't know a thing about scripting yet.
 
Old 08-15-2004, 06:06 PM   #4
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,568

Rep: Reputation: 164Reputation: 164
The safest thing is to add them at the end or at the beginning, as you won't put it into conditional section. I'd recommend file end, as your changes won't be modified by other commands in the file.
 
Old 08-16-2004, 06:10 PM   #5
z-vet
Member
 
Registered: Aug 2004
Location: Israel
Distribution: Ubuntu 10.10
Posts: 271

Original Poster
Rep: Reputation: 34
Thanks...
 
  


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
Environment variables setting... simjii SUSE / openSUSE 4 11-19-2005 08:50 PM
Scripts & Environment Variables geeman2.0 Linux - General 12 07-05-2005 06:10 PM
Need help setting environment variables. cottonmouth Linux - Newbie 3 12-09-2004 05:54 PM
Why can't my scripts set environment variables? Matthew3 Linux - Software 5 08-28-2004 06:26 PM
Environment Variables in Scripts louisb Linux - General 3 01-15-2004 05:56 PM


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