OpenCV error zlib.h: no such file or directory - opencv

I am trying to follow this website to install opencv4 on Ubuntu 18.04.
https://www.learnopencv.com/install-opencv-4-on-ubuntu-18-04/
But I get this error after make
In file included from /home/gosztolai/opencv/3rdparty/libpng/pngpriv.h:913:0,
from /home/gosztolai/opencv/3rdparty/libpng/png.c:14:
/home/gosztolai/opencv/3rdparty/libpng/pngstruct.h:30:10: fatal error: zlib.h: No such file or directory
#include "zlib.h"
I tried sudo apt install zlib1g-dev but the system says that it is already isntalled
Could someone help what is going on?

libpng uses the zlib library for image compression. To install it in Ubuntu, run the following code in your bash terminal:
sudo apt-get install zlib1g-dev
But because you already have it installed, and need a newer version, you need to update the library. Try to upgrade your packages, using this code:
sudo apt update
sudo apt upgrade -y
Or you can try to remove it using apt and install again.

Related

usr/bin/ld cannot find -lswipl

I am having this error "usr/bin/ld cannot find -lswipl" when I am compiling my ros package. I tried reinstalling of SWI-Prolog but still have this problem. Any help would be appreciated.
sudo apt-add-repository ppa:swi-prolog/stable
sudo apt update
sudo apt install swi-prolog

Nvidia 9.2 CUDA toolkit nvcc install error

I am trying to install the CUDA toolkit on Ubuntu 16.04 with
sudo apt-get install cuda
and keep getting the following error:
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
cuda : Depends: cuda-9-2 (>= 9.2.148) but it is not going to be
installed
E: Unable to correct problems, you have held broken packages
any help?
Option 1:
sudo apt-get install cuda-runtime-9-2
sudo apt-get install cuda-9-2
sudo apt-get install cuda
Option 2:
sudo apt-get install aptitude
sudo aptitude install cuda

Can't locate 'hdf5.h' during test

I tried to install the HDF5 library. I followed this guide Install_HDF5. In particular, I used:
sudo apt-get install libhdf5-serial-dev
sudo apt-get install libhdf5-mpich-dev
sudo apt-get install libhdf5-openmpi-dev
Up to this moment all the installations were successful. I tried to test it (make test) still following the guide, but I get:
fatal error hdf5.h no such file or directory
Could it concern a problem with my ~/.bashrc, i.e. with some missing path to hdf5?
P.S. I tested the Python module of HDF5 and it is working. I only received a warning message that I got rid of by using:
sudo python2.7 -m pip install git+https:://github.com/h5py/h5py.git --upgrade

Problems installing scikit-image in ubuntu 14.04

When I try to install scikit-image with pip2 there is show error. I have tried to find this problem solution.
Command python setup.py egg_info failed with error code 1 in /tmp/pip_build_root/scikit-image
Storing debug log for failure in /home/nshakib/.pip/pip.log
My guess is that you might have missing dependencies. I don't think Ubuntu 14.04 comes out of the box with any of the SciPy stack.
To answer your question try,
sudo apt-get install python-matplotlib python-numpy python-pil python-scipy
Then
sudo apt-get install build-essential cython
Finally
sudo apt-get install python-skimage
If that still doesn't work, you could try using the Anaconda Distribution for Python 2.7 from Continuum Analytics.
It comes with many of the major packages built-in and has a great package manager that manages dependencies.
https://docs.continuum.io/anaconda/install#anaconda-install
The conda package would be installed with conda install scikit-image

How to Install wkhtmltopdf?

Now i am working on rails 3.0.0.i am using Ubuntu 11.10 ,64 bit os.i want to install wkhtmltopdf.please tell me the static version of wkhtmltopdf.
Installing wkhtmltopdf
on Ubuntu Linux machine
First check os is 32 bit or 64 bit by using following command
Try uname -m. It seems like the uname -m actually gives x86_64 when it is an kernel 64 bits
Run following command
sudo apt-get install openssl build-essential xorg libssl-dev libxrender-dev
Then run following command
sudo apt-get install wkhtmltopdf
Based on OS download wkhtmltopdf package from following site
http://code.google.com/p/wkhtmltopdf/downloads/list
OR
wget http://wkhtmltopdf.googlecode.com/files/wkhtmltopdf-0.9.9-static-i386.tar.bz2
(wkhtmltopdf-0.9.9-static-i386.tar.bz2 is a stable release for wkhtmltopdf )
Then extract using command
tar xvjf wkhtmltopdf-0.9.9-static-i386.tar.bz2
Then move extracted DIR to usr/local/bin folder
sudo mv wkhtmltopdf-i386 /usr/local/bin/wkhtmltopdf
Check wkhtmltopdf is install or not using following command
which wkhtmltopdf
wkhtmltopdf –help
Installing wkhtmltopdf on MacOs
brew install Caskroom/cask/wkhtmltopdf
Another way to use official binaries within Rails is adding the following line to your Gemfile:
gem 'wkhtmltopdf-installer'
This way the official binaries from http://wkhtmltopdf.org will be downloaded and added to your bundle during bundle install phase.
I encountered this problem this morning.
Before you do anything, please check out: https://github.com/pdfkit/pdfkit/wiki/Installing-WKHTMLTOPDF
Download a binary edition of wkhtmltopdf at http://code.google.com/p/wkhtmltopdf/downloads/list
Decompress the package.
Copy the file like wkhtmltopdf-i386 to /usr/local/bin/ & /opt/ (also you could make soft link).
That's done.
Good luck.

Resources