Problem in installation of Opencv in ubuntu 16.04

asked 2017-05-24 00:15:51 -0600

sajeevank gravatar image

updated 2017-05-24 00:44:12 -0600

Hi, I was trying to install OpenCV, by using copied from the web page It is showing the following error while executing the command "make".

../../3rdparty/lib/liblibwebp.a: error adding symbols: File in wrong format
collect2: error: ld returned 1 exit status
modules/imgcodecs/CMakeFiles/opencv_imgcodecs.dir/build.make:589: recipe for target 'lib/' failed
make[2]: *** [lib/] Error 1
CMakeFiles/Makefile2:3237: recipe for target 'modules/imgcodecs/CMakeFiles/opencv_imgcodecs.dir/all' failed
make[1]: *** [modules/imgcodecs/CMakeFiles/opencv_imgcodecs.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....


Makefile:160: recipe for target 'all' failed
make: *** [all] Error 2
sudo: checkinstall: command not found
OpenCV 3.2.0 ready to be used

contents of file I used for this is shown below

version="$(wget -q -O - | egrep -m1 -o '\"[0-9](\.[0-9]+)+' | cut -c2-)"
echo "Installing OpenCV" $version
mkdir OpenCV
cd OpenCV
echo "Removing any pre-installed ffmpeg and x264"
sudo apt-get -qq remove ffmpeg x264 libx264-dev
echo "Installing Dependenices"
sudo apt-get -qq install libopencv-dev build-essential checkinstall cmake pkg-config yasm libjpeg-dev libjasper-dev libavcodec-dev libavformat$
echo "Downloading OpenCV" $version
wget -O OpenCV-$$version/opencv-"$version".zip/download
echo "Installing OpenCV" $version
unzip OpenCV-$
cd opencv-$version
mkdir build
cd build
make -j2
sudo checkinstall
sudo sh -c 'echo "/usr/local/lib" > /etc/'
sudo ldconfig
echo "OpenCV" $version "ready to be used"

Thanks in advance for the help.

Thanks & Regards, Sajeevan.K


I tried with another procedure in

For that cmake stage itself is failed. It is showing following messages.

-- Looking for pthread.h -- Looking for pthread.h - not found -- Check if the system is big endian -- Searching 16 bit integer -- Looking for sys/types.h -- Looking for sys/types.h - not found -- Looking for stdint.h -- Looking for stdint.h - not found -- Looking for stddef.h -- Looking for stddef.h - not found -- Check size of unsigned short -- Check size of unsigned short - failed -- Check size of unsigned int -- Check size of unsigned int - failed -- Check size of unsigned long -- Check size of unsigned long - failed CMake Error at /usr/share/cmake-3.5/Modules/TestBigEndian.cmake:51 (message): no suitable type found Call Stack (most recent call first): CMakeLists.txt:569 (test_big_endian)

-- Configuring incomplete, errors occurred! See also "/home/sajeevank/opencv/build/CMakeFiles/CMakeOutput.log". See also "/home/sajeevank/opencv/build/CMakeFiles/CMakeError.log".

I was suffering install opencv in ubuntu for two days. There are so many guides in net. But each procedure is failing at different stages.

Thanks for the help. Thanks and regards, Sajeevan.K

edit retag flag offensive close merge delete



the ubuntu help page is outdated (and ... well, sh647436)

do you need webp support ? you could disable it : cmake WITH_WEBP=OFF

berak gravatar imageberak ( 2017-05-24 00:24:33 -0600 )edit