Need help setting right environment variables:configure scripts can't find libraries.
Linux - NewbieThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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?
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.
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.