Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Errors after wrong installation of opencv

Hi , i'm trying to run an example of face detection using opencv , C++ , and QT from here : https://github.com/benhoff/opencv when running make i get the following errors

usr/local/include/opencv2/highgui/highgui.hpp:165:5: note: previous declaration ‘cv::<anonymous enum=""> IMREAD_UNCHANGED’ /usr/local/include/opencv2/imgcodecs.hpp error: redeclaration of ‘IMREAD_GRAYSCALE’ /usr/local/include/opencv2/imgcodecs.hpp error: redeclaration of ‘IMREAD_COLOR’ /usr/local/include/opencv2/imgcodecs.hpp:70:28: error: redeclaration of ‘IMREAD_ANYDEPTH’

...................

there are plenty of them

i think the problem is that i have installed firstly opencv 3.0.0 alpha and i want to change it to opencv 2.4.10 so what i have did is deleting manually all libraries and headers in /usr/local/lib and /usr/local/include (that because i haven't found a tutorial explaining how to properly delete opencv or re-install it) and after that i installed opencv 2.4.10

that's is the source of the error but now how can i solve this ??

Any suggestion will be appreciated :)

NB : I'm using ubuntu 14.04 , opencv 2.4.10 , QT 4.8.6

Errors after wrong installation of opencv

Hi , i'm trying to run an example of face detection using opencv , C++ , and QT from here : https://github.com/benhoff/opencv when running make i get the following errors

usr/local/include/opencv2/highgui/highgui.hpp:165:5: note: previous declaration ‘cv::<anonymous enum=""> IMREAD_UNCHANGED’ /usr/local/include/opencv2/imgcodecs.hpp error: redeclaration of ‘IMREAD_GRAYSCALE’ /usr/local/include/opencv2/imgcodecs.hpp error: redeclaration of ‘IMREAD_COLOR’ /usr/local/include/opencv2/imgcodecs.hpp:70:28: error: redeclaration of ‘IMREAD_ANYDEPTH’

...................

there are plenty of them

i think the problem is that i have installed firstly opencv 3.0.0 alpha and i want to change it to opencv 2.4.10 so what i have did is deleting manually all libraries and headers in /usr/local/lib and /usr/local/include (that because i haven't found a tutorial explaining how to properly delete opencv or re-install it) and after that i installed opencv 2.4.10

that's is the source of the error but now how can i solve this ??

?? solution ;: the code included 2 headers in the same time so i have commented the second line because i have opencv 2.4.10

#include <opencv2/imgproc/imgproc.hpp>  /* for opencv 2.4.10 */
//#include <opencv2/imgcodecs.hpp>       /* for opencv 3.0.0  */

update : here what i get now after make :

here is the error now after make :

faceDetector.cpp: In member function ‘void FaceDetector::process(cv::Mat)’: faceDetector.cpp:76:78: error: no matching function for call to ‘QImage::QImage(const unsigned char*, int&, int&, cv::Mat::MStep&, QImage::Format, void (*)(void*), cv::Mat*)’
                        QImage::Format_RGB888, &matDeleter, new cv::Mat(frame));
                                                                              ^ faceDetector.cpp:76:78: note: candidates are: In file included from /usr/include/qt4/QtGui/QImage:1:0,
                 from faceDetector.h:9,
                 from faceDetector.cpp:1: /usr/include/qt4/QtGui/qimage.h:139:5: note: QImage::QImage(const QImage&)
     QImage(const QImage &);
     ^ /usr/include/qt4/QtGui/qimage.h:139:5: note:   candidate

Any suggestion will be appreciated :)

NB : I'm using ubuntu 14.04 , opencv 2.4.10 , QT 4.8.6