Collectives™ on Stack Overflow
Find centralized, trusted content and collaborate around the technologies you use most.
Learn more about Collectives
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Learn more about Teams
I'm new to linux and using Eclipse Oxygen.2 Release 4.7.2 on Ubuntu 16.04
I'm getting the error:
/usr/lib/opencv-2.4.13.5/build/lib/libopencv_java2413.so: /lib/x86_64-linux-gnu/libz.so.1: version `ZLIB_1.2.9' not found (required by /home/mel3/anaconda/lib/libpng16.so.16)
I've tried upgrading and reloading and not sure if there is a path error or what going on. Help much appreciated
–
The accepted answer didn't work for me, but following here did:
https://ubuntuforums.org/showthread.php?t=2375927
Repeating the answer:
cd /your_software/../lib/ (the directory containing libz.so.1)
mv libz.so.1 libz.so.1.old
ln -s /lib/x86_64-linux-gnu/libz.so.1
–
–
–
./configure; make; make install
cd /lib/x86_64-linux-gnu
ln -s -f /usr/local/lib/libz.so.1.2.9/lib libz.so.1
rm -rf zlib-1.2.9
for details visit this link
–
–
–
–
The accepted answer did not work for me either, and I really suggest being careful when symlinking over a widely used binary like /lib/x86_64-linux-gnu/libz.so.1
.
The make uninstall
for zlib-1.2.9
will destroy this symlink, which will break a ton of packages and be a huge pain to fix.
Alex's solution worked for me and is much less destructive, since you're only modifying the symlink in the directory of your executable, not the whole system.
–
–
–
A safe option instead of messing up the system libraries is to download (or build) libz.so.1.2.9 and place it in the directory of your executable (or wherever) and export LD_LIBRARY_PATH to that directory
cd /<DIRECTORY OF YOUR EXECUTABLE NEEDING ZLIB__1.2.9>/
export LD_LIBRARY_PATH=$PWD
Now your executable will load the zlib from new location instead of /lib/x86_64-linux-gnu
check with
ldd <executable>
zlib should be referenced from new LD_LIBRARY_PATH
Worked for me:
wget https://github.com/madler/zlib/archive/v1.2.11.tar.gz
tar -zxvf v1.2.11.tar.gz
cd zlib-1.2.11
./configure --prefix=/bin/zlib/
make install
export LD_LIBRARY_PATH="/bin/zlib/lib":$LD_LIBRARY_PATH
If you have this error with reference to opencv-python, please check this issue in GitHub and consider reinstalling opencv-python tool:
pip3 install opencv-python==4.6.0.66
–
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.