I was trying to install a library called Openslide which failed during the ./configure step because it could not find a dependency (libjpeg).
I thought I would proceed to build libjpeg and then manually provide the library location to ./configure to make it work. After building libjpeg at ~/libjpeg, I thought I could just add ~/libjpeg/lib to LD_LIBRARY_PATH by putting the following in my bashrc and re-sourcing it LD_LIBRARY_PATH=~/libjpeg/lib:$LD_LIBRARY_PATH.
This didn't work and libjpeg still couldn't be found by the ./configure script in Openslide. I started hunting down answers online, one suggestion was to try ./configure --with-libjpeg=~/libjpeg/lib which also failed.
I eventually gave up and just did a sudo apt install, but I am still curious as to why I couldn't manually provide the location of the library. Is there a correct way to do this?
libjpegbuild on the system does not have apkg-configdirectory? All that was in the build wasbin,man, andlib. Also how did you know where to track that down? Was I crazy to think it could beLD_LIBRARY_PATH? – Joff Nov 22 '22 at 15:07LD_LIBRARY_PATHfor this is a common mistake, not helped by the ambiguous variable name; it’s only used by the dynamic loader, not by the linker (directly). It doesn’t matter that yourlibjpegbuild doesn’t have apkg-configdirectory; all that matters is that it produces alibjpeg.pcfile and that you pointpkg-configat it. – Stephen Kitt Nov 22 '22 at 15:19