Installing on Ubuntu 14.04: 'make' errors

asked 2014-07-12 10:48:28 -0500

thoraz gravatar image

Hi everyone! I'm trying to install OpenCV 2.4.9 on my Ubuntu 14.04, but I have already some problems. When I configure with ccmake and then press g to generate, all goes good. But when I launch make command in the 'build' directory, it stops with an error about tiff function in /opencv-2.4.9/3rdparty/libtiff/tif_compress.c:

[ 3%] Building C object 3rdparty/libtiff/CMakeFiles/libtiff.dir/tif_compress.c.o cd /home/andrea/opencv-2.4.9/build/3rdparty/libtiff && /usr/bin/cc -fsigned-char -W -Wall -Werror=return-type -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wcast-align -Wstrict-aliasing=2 -fdiagnostics-show-option -Wno-long-long -pthread -Werror -ffast-math -msse -msse2 -mavx --coverage -fPIC -O3 -DNDEBUG -DNDEBUG -I/home/andrea/opencv-2.4.9/build/3rdparty/zlib -I/home/andrea/opencv-2.4.9/3rdparty/zlib -I/home/andrea/opencv-2.4.9/build/3rdparty/libtiff -I/home/andrea/opencv-2.4.9/3rdparty/libtiff -I/home/andrea/opencv-2.4.9/build -o CMakeFiles/libtiff.dir/tif_compress.c.o -c /home/andrea/opencv-2.4.9/3rdparty/libtiff/tif_compress.c /home/andrea/opencv-2.4.9/3rdparty/libtiff/tif_compress.c:1:0: error: cannot open CMakeFiles/libtiff.dir/tif_compress.c.gcno /* $Id: tif_compress.c,v 1.22 2010-03-10 18:56:48 bfriesen Exp $ / ^ /home/andrea/opencv-2.4.9/3rdparty/libtiff/tif_compress.c:89:1: error: no previous prototype for ‘_TIFFNoFixupTags’ [-Werror=missing-prototypes] _TIFFNoFixupTags(TIFF tif) ^ cc1: all warnings being treated as errors make[2]: * [3rdparty/libtiff/CMakeFiles/libtiff.dir/tif_compress.c.o] Errore 1 make[2]: uscita dalla directory "/home/andrea/opencv-2.4.9/build" make[1]: [3rdparty/libtiff/CMakeFiles/libtiff.dir/all] Errore 2 make[1]: uscita dalla directory "/home/andrea/opencv-2.4.9/build" make: ** [all] Errore 2

I have tried to configure without TIFF settings but it stops again with the same error about JPEG:

[ 2%] Building C object 3rdparty/libjpeg/CMakeFiles/libjpeg.dir/jquant2.c.o cd /home/andrea/opencv-2.4.9/build/3rdparty/libjpeg && /usr/bin/cc -fsigned-char -W -Wall -Werror=return-type -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wcast-align -Wstrict-aliasing=2 -fdiagnostics-show-option -Wno-long-long -pthread -Werror -ffast-math -msse -msse2 -mavx --coverage -fPIC -O3 -DNDEBUG -DNDEBUG -I/home/andrea/opencv-2.4.9/3rdparty/libjpeg -I/home/andrea/opencv-2.4.9/build -o CMakeFiles/libjpeg.dir/jquant2.c.o -c /home/andrea/opencv-2.4.9/3rdparty/libjpeg/jquant2.c /home/andrea/opencv-2.4.9/3rdparty/libjpeg/jquant2.c: In function ‘prescan_quantize’: /home/andrea/opencv-2.4.9/3rdparty/libjpeg/jquant2.c:225:22: error: unused parameter ‘output_buf’ [-Werror=unused-parameter] JSAMPARRAY output_buf, int num_rows) ^ /home/andrea/opencv-2.4.9/3rdparty/libjpeg/jquant2.c: In function ‘finish_pass2’: /home/andrea/opencv-2.4.9/3rdparty/libjpeg/jquant2.c:1156:32: error: unused parameter ‘cinfo’ [-Werror=unused-parameter] finish_pass2 (j_decompress_ptr cinfo) ^ cc1: all warnings being treated as errors make[2]: * [3rdparty/libjpeg/CMakeFiles/libjpeg.dir/jquant2.c.o] Errore 1 make[2]: uscita dalla directory "/home/andrea/opencv-2.4.9/build" make[1]: [3rdparty/libjpeg/CMakeFiles/libjpeg.dir/all ... (more)

edit retag flag offensive close merge delete


Did you follow the official Ubuntu guide? Worked perfectly for me in Ubuntu 14.04, even managed to get CUDA6.0 support.

Just make sure you have latest libjpeg and libtiff versions installed on your system. This can be done by using the following command

 [compiler] sudo apt-get install build-essential
 [required] sudo apt-get install cmake git libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev
 [optional] sudo apt-get install python-dev python-numpy libtbb2 libtbb-dev libjpeg-dev libpng-dev libtiff-dev libjasper-dev libdc1394-22-dev
StevenPuttemans gravatar imageStevenPuttemans ( 2014-07-14 06:10:08 -0500 )edit

The docs were updated after the 2.4.9 stable release by myself and the updated doc can be seen here

StevenPuttemans gravatar imageStevenPuttemans ( 2014-07-14 06:11:03 -0500 )edit

One question: when I have to type

cd ~/<my_working _directory> git clone

<my_working _directory> is a particular directory? I have typed

git clone

in the ~/opencv-2.4.9 directory but still not works.

thoraz gravatar imagethoraz ( 2014-07-15 10:59:50 -0500 )edit


what is the response when you do the git clone?

JewelCV gravatar imageJewelCV ( 2014-07-23 12:25:24 -0500 )edit

I've made a how-to of Installing OpenCV 3.0.0 on Ubuntu 14.04: A script is given, so probably everything will work just fine.

Rodrigo Berriel gravatar imageRodrigo Berriel ( 2014-10-18 09:47:41 -0500 )edit