The error /usr/bin/ld: cannot find -l<library> (e.g., -lpng, -ljpeg, -ltiff, -lwebp) means the linker (ld) cannot find the required static or shared libraries for libpng, libjpeg, libtiff, and libwebp. Even though you installed the dependencies in ~/rpm/x86_64/, the linker is not searching that directory for libraries.
LIBRARY_PATH and LD_LIBRARY_PATHThe linker (ld) and runtime linker use these environment variables to locate libraries.
bash# For the current session (temporary) export LIBRARY_PATH=~/rpm/x86_64/usr/lib:$LIBRARY_PATH export LD_LIBRARY_PATH=~/rpm/x86_64/usr/lib:$LD_LIBRARY_PATH # For permanent use, add these lines to your ~/.bashrc or ~/.bash_profile echo 'export LIBRARY_PATH=~/rpm/x86_64/usr/lib:$LIBRARY_PATH' >> ~/.bashrc echo 'export LD_LIBRARY_PATH=~/rpm/x86_64/usr/lib:$LD_LIBRARY_PATH' >> ~/.bashrc source ~/.bashrc
Note:
LIBRARY_PATHis for compile-time linking.LD_LIBRARY_PATHis for runtime linking.
Ensure the .so (shared object) files for the missing libraries exist in ~/rpm/x86_64/usr/lib/:
bashls ~/rpm/x86_64/usr/lib/libpng* ls ~/rpm/x86_64/usr/lib/libjpeg* ls ~/rpm/x86_64/usr/lib/libtiff* ls ~/rpm/x86_64/usr/lib/libwebp*
If they are missing, you need to install the development packages for these libraries (e.g., libpng-devel, libjpeg-turbo-devel, libtiff-devel, libwebp-devel) in your ~/rpm/x86_64/ directory.
If the libraries are missing, reinstall them in ~/rpm/x86_64/ using rpm or yum:
bash# Example for libpng (adjust for your RPMs) rpm -ivh --prefix=~/rpm/x86_64 libpng-devel-*.rpm rpm -ivh --prefix=~/rpm/x86_64 libjpeg-turbo-devel-*.rpm rpm -ivh --prefix=~/rpm/x86_64 libtiff-devel-*.rpm rpm -ivh --prefix=~/rpm/x86_64 libwebp-devel-*.rpm
Note: Use
--prefixto install RPMs in a custom directory.
If the above doesn’t work, explicitly pass the library paths to the build process:
bash# Set these before running `uv pip install iio==29` export CFLAGS="-I~/rpm/x86_64/usr/include" export LDFLAGS="-L~/rpm/x86_64/usr/lib -lpng -ljpeg -ltiff -lwebp" uv pip install iio==29
Ensure all libraries are 64-bit (since you’re using x86_64). If you accidentally installed 32-bit libraries, the linker will fail.
bashfile ~/rpm/x86_64/usr/lib/libpng.so*
Output should include
ELF 64-bit.
To see where the linker is searching for libraries:
bashld -v
or
bashgcc -v -o /dev/null -lpng
bash# 1. Set library paths export LIBRARY_PATH=~/rpm/x86_64/usr/lib:$LIBRARY_PATH export LD_LIBRARY_PATH=~/rpm/x86_64/usr/lib:$LD_LIBRARY_PATH # 2. Verify libraries exist ls ~/rpm/x86_64/usr/lib/libpng* ~/rpm/x86_64/usr/lib/libjpeg* ~/rpm/x86_64/usr/lib/libtiff* ~/rpm/x86_64/usr/lib/libwebp* # 3. Reinstall dependencies if missing rpm -ivh --prefix=~/rpm/x86_64 libpng-devel-*.rpm libjpeg-turbo-devel-*.rpm libtiff-devel-*.rpm libwebp-devel-*.rpm # 4. Retry installation uv pip install iio==29
libpng12.so instead of libpng.so).ldconfig to update the shared library cache (if you have root access):
bashsudo ldconfig
LIBRARY_PATH and LD_LIBRARY_PATH.Vibe can make mistakes. Check answers. Learn more