Problem in installation of Opencv in ubuntu 16.04

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

sajeevank gravatar image

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

Hi, I was trying to install OpenCV, by using opencv.sh copied from the web page https://help.ubuntu.com/community/OpenCV. 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/libopencv_imgcodecs.so.3.2.0' failed
make[2]: *** [lib/libopencv_imgcodecs.so.3.2.0] 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 opencv.sh file I used for this is shown below

version="$(wget -q -O - http://sourceforge.net/projects/opencvlibrary/files/opencv-unix | 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.zip http://sourceforge.net/projects/opencvlibrary/files/opencv-unix/$version/opencv-"$version".zip/download
echo "Installing OpenCV" $version
unzip OpenCV-$version.zip
cd opencv-$version
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=RELEASE -DCMAKE_INSTALL_PREFIX=/usr/local -DWITH_TBB=ON -DBUILD_NEW_PYTHON_SUPPORT=ON -DWITH_V4L=ON -DINSTALL_C_EXAMP$
#cmake -DCMAKE_BUILD_TYPE=RELEASE -DCMAKE_INSTALL_PREFIX=/usr/local -DOPENCV_EXTRA_MODULES_PATH=../../opencv_contrib/modules -DWITH_EIGEN=ON -$
make -j2
sudo checkinstall
sudo sh -c 'echo "/usr/local/lib" > /etc/ld.so.conf.d/opencv.conf'
sudo ldconfig
echo "OpenCV" $version "ready to be used"

Thanks in advance for the help.

Thanks & Regards, Sajeevan.K

Hi,

I tried with another procedure in http://docs.opencv.org/2.4/doc/tutori....

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

Comments

1

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 -0500 )edit