PDA

View Full Version : Opencv include problem



cae
12th February 2010, 08:33
Hi, i`ve been reading a lot about how to configure OpenCV with QtCreator(the one i use) eclipse... dev-c++ .... and got nothing clear...

I`ve installed openCV in Windows, and added de path to the system paths, and later on, i´ve created a project with the following .pro file:

# -------------------------------------------------
# Project created by QtCreator 2010-02-11T12:03:47
# -------------------------------------------------
QT += opengl
TARGET = calibrar
TEMPLATE = app
LIBS += -LC:\OpenCV2.0\lib \
-lhighgui200 \
-lcv200 \
-lcxcore200
INCLUDEPATH += C:\OpenCV2.0\include\opencv
SOURCES += main.cpp \
mainwindow.cpp
HEADERS += mainwindow.h


Then i have my mainwindow.cpp


#include "mainwindow.h"
#include <math.h>
#include <cv.h>
#include <cvaux.h>
#include <highgui.h>
MainWindow::MainWindow(QWidget *parent)
: QMainWindow(parent)
{
}
MainWindow::~MainWindow()
{

}

The includes aren't underlined with yellow as happend the first times i tried, but when i try to build my program i get many errors from inside the opencv files!!!


Running build steps for project calibrar...
Configuration unchanged, skipping QMake step.
Starting: C:/Qt/2009.04/mingw/bin/mingw32-make.exe -w
mingw32-make: Entering directory `C:/Documents and Settings/Cesar/Mis documentos/calibrar'
C:/Qt/2009.04/mingw/bin/mingw32-make -f Makefile.Debug
mingw32-make[1]: Entering directory `C:/Documents and Settings/Cesar/Mis documentos/calibrar'
g++ -c -g -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_OPENGL_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -I"..\..\..\..\Qt\2009.04\qt\include\QtCore" -I"..\..\..\..\Qt\2009.04\qt\include\QtGui" -I"..\..\..\..\Qt\2009.04\qt\include\QtOpenGL" -I"..\..\..\..\Qt\2009.04\qt\include" -I"..\..\..\..\OpenCV2.0\include\opencv" -I"..\..\..\..\Qt\2009.04\qt\include\ActiveQt" -I"debug" -I"..\..\..\..\Qt\2009.04\qt\mkspecs\win32-g++" -o debug\mainwindow.o mainwindow.cpp



//from here all red :)

In file included from ../../../../OpenCV2.0/include/opencv/cxcore.hpp:2243,
from ../../../../OpenCV2.0/include/opencv/cxcore.h:2123,
from ../../../../OpenCV2.0/include/opencv/cv.h:58,
from mainwindow.cpp:3:
../../../../OpenCV2.0/include/opencv/cxoperations.hpp: In member function `void cv::Ptr<_Tp>::addref()':
../../../../OpenCV2.0/include/opencv/cxoperations.hpp:1442: error: there are no arguments to `__exchange_and_add' that depend on a template parameter, so a declaration of `__exchange_and_add' must be available
../../../../OpenCV2.0/include/opencv/cxoperations.hpp:1442: error: (if you use `-fpermissive', G++ will accept your code, but allowing the use of an undeclared name is deprecated)
../../../../OpenCV2.0/include/opencv/cxoperations.hpp: In member function `void cv::Ptr<_Tp>::release()':
../../../../OpenCV2.0/include/opencv/cxoperations.hpp:1446: error: there are no arguments to `__exchange_and_add' that depend on a template parameter, so a declaration of `__exchange_and_add' must be available
../../../../OpenCV2.0/include/opencv/cxoperations.hpp: In member function `cv::Ptr<_Tp>& cv::Ptr<_Tp>::operator=(const cv::Ptr<_Tp>&)':
../../../../OpenCV2.0/include/opencv/cxoperations.hpp:1473: error: there are no arguments to `__exchange_and_add' that depend on a template parameter, so a declaration of `__exchange_and_add' must be available
In file included from ../../../../OpenCV2.0/include/opencv/cxcore.hpp:2244,
from ../../../../OpenCV2.0/include/opencv/cxcore.h:2123,
from ../../../../OpenCV2.0/include/opencv/cv.h:58,
from mainwindow.cpp:3:
../../../../OpenCV2.0/include/opencv/cxmat.hpp: In copy constructor `cv::Mat::Mat(const cv::Mat&)':
../../../../OpenCV2.0/include/opencv/cxmat.hpp:102: error: `__exchange_and_add' was not declared in this scope
../../../../OpenCV2.0/include/opencv/cxmat.hpp:102: warning: unused variable '__exchange_and_add'
../../../../OpenCV2.0/include/opencv/cxmat.hpp: In constructor `cv::Mat::Mat(const cv::Mat&, const cv::Range&, const cv::Range&)':
../../../../OpenCV2.0/include/opencv/cxmat.hpp:174: error: `__exchange_and_add' was not declared in this scope
../../../../OpenCV2.0/include/opencv/cxmat.hpp:174: warning: unused variable '__exchange_and_add'
../../../../OpenCV2.0/include/opencv/cxmat.hpp: In constructor `cv::Mat::Mat(const cv::Mat&, const cv::Rect&)':
../../../../OpenCV2.0/include/opencv/cxmat.hpp:189: error: `__exchange_and_add' was not declared in this scope
../../../../OpenCV2.0/include/opencv/cxmat.hpp:189: warning: unused variable '__exchange_and_add'
../../../../OpenCV2.0/include/opencv/cxmat.hpp: In member function `cv::Mat& cv::Mat::operator=(const cv::Mat&)':
../../../../OpenCV2.0/include/opencv/cxmat.hpp:239: error: `__exchange_and_add' was not declared in this scope
../../../../OpenCV2.0/include/opencv/cxmat.hpp:239: warning: unused variable '__exchange_and_add'
../../../../OpenCV2.0/include/opencv/cxmat.hpp: In member function `void cv::Mat::addref()':
../../../../OpenCV2.0/include/opencv/cxmat.hpp:342: error: `__exchange_and_add' was not declared in this scope
../../../../OpenCV2.0/include/opencv/cxmat.hpp:342: warning: unused variable '__exchange_and_add'
../../../../OpenCV2.0/include/opencv/cxmat.hpp: In member function `void cv::Mat::release()':
../../../../OpenCV2.0/include/opencv/cxmat.hpp:346: error: `__exchange_and_add' was not declared in this scope
../../../../OpenCV2.0/include/opencv/cxmat.hpp:346: warning: unused variable '__exchange_and_add'
../../../../OpenCV2.0/include/opencv/cxmat.hpp: In copy constructor `cv::MatND::MatND(const cv::MatND&)':
../../../../OpenCV2.0/include/opencv/cxmat.hpp:3648: error: `__exchange_and_add' was not declared in this scope
../../../../OpenCV2.0/include/opencv/cxmat.hpp:3648: warning: unused variable '__exchange_and_add'
../../../../OpenCV2.0/include/opencv/cxmat.hpp: In member function `cv::MatND& cv::MatND::operator=(const cv::MatND&)':
../../../../OpenCV2.0/include/opencv/cxmat.hpp:3677: error: `__exchange_and_add' was not declared in this scope
../../../../OpenCV2.0/include/opencv/cxmat.hpp:3677: warning: unused variable '__exchange_and_add'
../../../../OpenCV2.0/include/opencv/cxmat.hpp: In member function `void cv::MatND::addref()':
../../../../OpenCV2.0/include/opencv/cxmat.hpp:3717: error: `__exchange_and_add' was not declared in this scope
../../../../OpenCV2.0/include/opencv/cxmat.hpp:3717: warning: unused variable '__exchange_and_add'
../../../../OpenCV2.0/include/opencv/cxmat.hpp: In member function `void cv::MatND::release()':
../../../../OpenCV2.0/include/opencv/cxmat.hpp:3722: error: `__exchange_and_add' was not declared in this scope
../../../../OpenCV2.0/include/opencv/cxmat.hpp:3722: warning: unused variable '__exchange_and_add'
../../../../OpenCV2.0/include/opencv/cxmat.hpp: In member function `cv::SparseMat& cv::SparseMat::operator=(const cv::SparseMat&)':
../../../../OpenCV2.0/include/opencv/cxmat.hpp:4081: error: `__exchange_and_add' was not declared in this scope
../../../../OpenCV2.0/include/opencv/cxmat.hpp:4081: warning: unused variable '__exchange_and_add'
../../../../OpenCV2.0/include/opencv/cxmat.hpp: In member function `void cv::SparseMat::addref()':
../../../../OpenCV2.0/include/opencv/cxmat.hpp:4112: error: `__exchange_and_add' was not declared in this scope
../../../../OpenCV2.0/include/opencv/cxmat.hpp:4112: warning: unused variable '__exchange_and_add'
../../../../OpenCV2.0/include/opencv/cxmat.hpp: In member function `void cv::SparseMat::release()':
../../../../OpenCV2.0/include/opencv/cxmat.hpp:4116: error: `__exchange_and_add' was not declared in this scope
../../../../OpenCV2.0/include/opencv/cxmat.hpp:4116: warning: unused variable '__exchange_and_add'
mingw32-make[1]: Leaving directory `C:/Documents and Settings/Cesar/Mis documentos/calibrar'
mingw32-make: Leaving directory `C:/Documents and Settings/Cesar/Mis documentos/calibrar'
mingw32-make[1]: *** [debug/mainwindow.o] Error 1
mingw32-make: *** [debug] Error 2
Exited with code 2.
Error while building project calibrar
When executing build step 'Make'


Can anybody help me?

high_flyer
12th February 2010, 09:05
I think this (http://n2.nabble.com/Problem-using-opencv2-0-td4107832.html)might help you...

cae
12th February 2010, 09:25
THANKS!!!!!!!!

i've been 2 days stuck with that!!!