Linux From ScratchThis Forum is for the discussion of LFS.
LFS is a project that provides you with the steps necessary to build your own custom Linux system.
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.
Distribution: tried a lot of 'em, now using kubuntu
Posts: 180
Rep:
Problems with libraries
I have LFS4.0 on a stand-alone system ( I deleted my base distro). I am slugging my way through the parts of BLFS that I want to install and am running into weird problems, to wit:
1) I have installed libjpeg6b (as per BLFS instructions), however, every program that I install says "checking for libjpeg6b... no". I know that the libraries are there. I have added the directory to ld.so.conf. I have run ldconfig as root. Why is configure not finding it?
2) I am trying to install KDE. Got artsd installed. Then moved on to kdelibs. It, too, cannot find libjpeg6b, but then it says that qt is not installed. I KNOW that qt is installed (as per BLFS instructions), I even went to the directory that qt is in and ran designer. It DID start. $QTDIR is set correctly in my ~/.bash_profile, and $QTDIR/bin is in my path. The library path is set in ld.so.conf (/opt/qt/lib/). Any ideas?
3) So, I said enough of this for now, let's go get a game and have a little fun. I downloaded cube (FPS), and found that I needed SDL libraries. I downloaded it, installed it, and tried to install cube again. It said that I needed SDL_image. I finally found it, installed it (no apparent errors). Tried to install cube again, it STILL says that I need SDL_image. SDL has been installing libraries in /usr/local/lib, and that is in ld.so.conf. I have run ldconfig. What is making all of these libraries invisible to "configure"?
Distribution: tried a lot of 'em, now using kubuntu
Posts: 180
Original Poster
Rep:
Another piece to the puzzle:
I went into my .bash_profile and added all of the directories that were in ld.so.conf into the LD_LIBRARY_PATH . Problem #3 went away (well, at least it went further before it bombed out).
Problem #2 also went away after doing this.
Why would my system require the library directories to be in the LD_LIBRARY_PATH instead of reading them from ld.so.conf? I have LD_LIBRARY_PATH=$LD_LIBRARY_PATH:blah:blah:blah.
Distribution: tried a lot of 'em, now using kubuntu
Posts: 180
Original Poster
Rep:
Baloo: yep. Did the ldconfig thing as root.
Bert: that's cool. But the problem remains, that until I put the directories into .bash_profile as an entry in LD_LIBRARY_PATH, the system doesn't see them. However, tonight I will comment out the LD_LIBR... line, and see if the system will work correctly with just the /etc/ld.so.conf I mean, it's working now, but everytime I need to add a directory to ld.so.conf, I have to remember to add it to the .bash_profile, too.
I think i am having a similar problem with libraries. I compile and install them, but ./configure doesnt seem to recognize them. I check paths in ld.so.conifg but no help. I run ldconfig, but no help.
How do you specify them in .bash_profile or etc/profile (as in my case with slackware)?
I think that "configure" looks at predetermined places for what it is searching for without caring much of the LD_PATH so for example it is easier to use export before ./configure to tell the program where are somme libraries especially when they are not in/lib /usr/lib or /usr/local/lib. For example with qt in /opt/lib/qt I would do the following for kdelibs:
tar xfvj kdelibs-3.1.tar.bz2
mv kdelibs-3.1
export QTDIR=/opt/lib/qt and then
./configure
sometimes you need to export the CFLAGS and CXXFLAGS otherwise they wont be considered if they are only in the .bash_profile....
for some programs where there is no configure you have to take a look at the Makefile and edit it if the path they assume for certains libraries or programs don't correspond to your installation.....
I've had a similar problem before. It came about because I installed some libraries into /usr/local. I ended up re-installing them, but someone also suggested to me that I export some ldflags before I run configure:
export LDFLAGS="-L/usr/local/lib"
I think that this was the command, but since I've never really played around w/ compiler opt's (and I'm at school) I can't verify that for you.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.