Problem using opencv2.0

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Problem using opencv2.0

Gonçalo Monteiro
Hello!
I am testing openCV 2.0 using DevCpp. I created a cpp project to test the facedetect example. Below is the result of the compiler. Can anyone help me to solve this problem?
Thanks!


g++.exe -c main.cpp -o main.o -I"lib/gcc/mingw32/3.4.2/include"  -I"include/c++/3.4.2/backward"  -I"include/c++/3.4.2/mingw32"  -I"include/c++/3.4.2"  -I"include"  -I"C:/OpenCV/include/opencv"  

In file included from C:/OpenCV/include/opencv/cxcore.hpp:2243,
                 from C:/OpenCV/include/opencv/cxcore.h:2123,

                 from C:/OpenCV/include/opencv/cv.h:58,
                 from main.cpp:3:
C:/OpenCV/include/opencv/cxoperations.hpp: In member function `void cv::Ptr<_Tp>::addref()':
C:/OpenCV/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
C:/OpenCV/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)
C:/OpenCV/include/opencv/cxoperations.hpp: In member function `void cv::Ptr<_Tp>::release()':
C:/OpenCV/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

C:/OpenCV/include/opencv/cxoperations.hpp: In member function `cv::Ptr<_Tp>& cv::Ptr<_Tp>::operator=(const cv::Ptr<_Tp>&)':
C:/OpenCV/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 C:/OpenCV/include/opencv/cxcore.hpp:2244,
                 from C:/OpenCV/include/opencv/cxcore.h:2123,

                 from C:/OpenCV/include/opencv/cv.h:58,
                 from main.cpp:3:
C:/OpenCV/include/opencv/cxmat.hpp: In copy constructor `cv::Mat::Mat(const cv::Mat&)':
C:/OpenCV/include/opencv/cxmat.hpp:102: error: `__exchange_and_add' undeclared (first use this function)
C:/OpenCV/include/opencv/cxmat.hpp:102: error: (Each undeclared identifier is reported only once for each function it appears in.)

C:/OpenCV/include/opencv/cxmat.hpp: In constructor `cv::Mat::Mat(const cv::Mat&, const cv::Range&, const cv::Range&)':
C:/OpenCV/include/opencv/cxmat.hpp:174: error: `__exchange_and_add' undeclared (first use this function)

C:/OpenCV/include/opencv/cxmat.hpp: In constructor `cv::Mat::Mat(const cv::Mat&, const cv::Rect&)':
C:/OpenCV/include/opencv/cxmat.hpp:189: error: `__exchange_and_add' undeclared (first use this function)

C:/OpenCV/include/opencv/cxmat.hpp: In member function `cv::Mat& cv::Mat::operator=(const cv::Mat&)':
C:/OpenCV/include/opencv/cxmat.hpp:239: error: `__exchange_and_add' undeclared (first use this function)

C:/OpenCV/include/opencv/cxmat.hpp: In member function `void cv::Mat::addref()':
C:/OpenCV/include/opencv/cxmat.hpp:342: error: `__exchange_and_add' undeclared (first use this function)

C:/OpenCV/include/opencv/cxmat.hpp: In member function `void cv::Mat::release()':
C:/OpenCV/include/opencv/cxmat.hpp:346: error: `__exchange_and_add' undeclared (first use this function)

C:/OpenCV/include/opencv/cxmat.hpp: In copy constructor `cv::MatND::MatND(const cv::MatND&)':
C:/OpenCV/include/opencv/cxmat.hpp:3648: error: `__exchange_and_add' undeclared (first use this function)

C:/OpenCV/include/opencv/cxmat.hpp: In member function `cv::MatND& cv::MatND::operator=(const cv::MatND&)':
C:/OpenCV/include/opencv/cxmat.hpp:3677: error: `__exchange_and_add' undeclared (first use this function)

C:/OpenCV/include/opencv/cxmat.hpp: In member function `void cv::MatND::addref()':
C:/OpenCV/include/opencv/cxmat.hpp:3717: error: `__exchange_and_add' undeclared (first use this function)
C:/OpenCV/include/opencv/cxmat.hpp: In member function `void cv::MatND::release()':
C:/OpenCV/include/opencv/cxmat.hpp:3722: error: `__exchange_and_add' undeclared (first use this function)

C:/OpenCV/include/opencv/cxmat.hpp: In member function `cv::SparseMat& cv::SparseMat::operator=(const cv::SparseMat&)':
C:/OpenCV/include/opencv/cxmat.hpp:4081: error: `__exchange_and_add' undeclared (first use this function)

C:/OpenCV/include/opencv/cxmat.hpp: In member function `void cv::SparseMat::addref()':
C:/OpenCV/include/opencv/cxmat.hpp:4112: error: `__exchange_and_add' undeclared (first use this function)
C:/OpenCV/include/opencv/cxmat.hpp: In member function `void cv::SparseMat::release()':
C:/OpenCV/include/opencv/cxmat.hpp:4116: error: `__exchange_and_add' undeclared (first use this function)

make.exe: *** [main.o] Error 1

Execution terminated

Reply | Threaded
Open this post in threaded view
|

Re: Problem using opencv2.0

Jean-Pierre Landry
Don't really know exactly by your error seems to be similar to what is
described here: ( http://opencv.willowgarage.com/wiki/InstallGuide )


Building on Windows using MinGW 3.4.5

     *

       If you get compile errors to do with __exchange_and_add it is due
to the wrong definition of CV_XADD. It can be fixed by:
          1.

             Open cxoperations.hpp (found in <Open CV base
dir>\include\opencv)
          2. Find this section (lines 67-68 in 2.0):

               #else
                 #include <bits/atomicity.h>
                 #if __GNUC__ >= 4

          3.

             And update it to reference a new definition, __MINGW32__
(defined by the MinGW compiler, see
http://predef.sourceforge.net/precomp.html#sec31):

               #else
                 #include <bits/atomicity.h>
                 #if __GNUC__ >= 4 || __MINGW32__



goncalus wrote:

> Hello!
> I am testing openCV 2.0 using DevCpp. I created a cpp project to test the facedetect example. Below is the result of the compiler. Can anyone help me to solve this problem?
> Thanks!
>
>
> g++.exe -c main.cpp -o main.o -I"lib/gcc/mingw32/3.4.2/include"  -I"include/c++/3.4.2/backward"  -I"include/c++/3.4.2/mingw32"  -I"include/c++/3.4.2"  -I"include"  -I"C:/OpenCV/include/opencv"  
>
> In file included from C:/OpenCV/include/opencv/cxcore.hpp:2243,
>                  from C:/OpenCV/include/opencv/cxcore.h:2123,
>
>                  from C:/OpenCV/include/opencv/cv.h:58,
>                  from main.cpp:3:
> C:/OpenCV/include/opencv/cxoperations.hpp: In member function `void cv::Ptr<_Tp>::addref()':
> C:/OpenCV/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
> C:/OpenCV/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)
> C:/OpenCV/include/opencv/cxoperations.hpp: In member function `void cv::Ptr<_Tp>::release()':
> C:/OpenCV/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
>
> C:/OpenCV/include/opencv/cxoperations.hpp: In member function `cv::Ptr<_Tp>& cv::Ptr<_Tp>::operator=(const cv::Ptr<_Tp>&)':
> C:/OpenCV/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 C:/OpenCV/include/opencv/cxcore.hpp:2244,
>                  from C:/OpenCV/include/opencv/cxcore.h:2123,
>
>                  from C:/OpenCV/include/opencv/cv.h:58,
>                  from main.cpp:3:
> C:/OpenCV/include/opencv/cxmat.hpp: In copy constructor `cv::Mat::Mat(const cv::Mat&)':
> C:/OpenCV/include/opencv/cxmat.hpp:102: error: `__exchange_and_add' undeclared (first use this function)
> C:/OpenCV/include/opencv/cxmat.hpp:102: error: (Each undeclared identifier is reported only once for each function it appears in.)
>
> C:/OpenCV/include/opencv/cxmat.hpp: In constructor `cv::Mat::Mat(const cv::Mat&, const cv::Range&, const cv::Range&)':
> C:/OpenCV/include/opencv/cxmat.hpp:174: error: `__exchange_and_add' undeclared (first use this function)
>
> C:/OpenCV/include/opencv/cxmat.hpp: In constructor `cv::Mat::Mat(const cv::Mat&, const cv::Rect&)':
> C:/OpenCV/include/opencv/cxmat.hpp:189: error: `__exchange_and_add' undeclared (first use this function)
>
> C:/OpenCV/include/opencv/cxmat.hpp: In member function `cv::Mat& cv::Mat::operator=(const cv::Mat&)':
> C:/OpenCV/include/opencv/cxmat.hpp:239: error: `__exchange_and_add' undeclared (first use this function)
>
> C:/OpenCV/include/opencv/cxmat.hpp: In member function `void cv::Mat::addref()':
> C:/OpenCV/include/opencv/cxmat.hpp:342: error: `__exchange_and_add' undeclared (first use this function)
>
> C:/OpenCV/include/opencv/cxmat.hpp: In member function `void cv::Mat::release()':
> C:/OpenCV/include/opencv/cxmat.hpp:346: error: `__exchange_and_add' undeclared (first use this function)
>
> C:/OpenCV/include/opencv/cxmat.hpp: In copy constructor `cv::MatND::MatND(const cv::MatND&)':
> C:/OpenCV/include/opencv/cxmat.hpp:3648: error: `__exchange_and_add' undeclared (first use this function)
>
> C:/OpenCV/include/opencv/cxmat.hpp: In member function `cv::MatND& cv::MatND::operator=(const cv::MatND&)':
> C:/OpenCV/include/opencv/cxmat.hpp:3677: error: `__exchange_and_add' undeclared (first use this function)
>
> C:/OpenCV/include/opencv/cxmat.hpp: In member function `void cv::MatND::addref()':
> C:/OpenCV/include/opencv/cxmat.hpp:3717: error: `__exchange_and_add' undeclared (first use this function)
> C:/OpenCV/include/opencv/cxmat.hpp: In member function `void cv::MatND::release()':
> C:/OpenCV/include/opencv/cxmat.hpp:3722: error: `__exchange_and_add' undeclared (first use this function)
>
> C:/OpenCV/include/opencv/cxmat.hpp: In member function `cv::SparseMat& cv::SparseMat::operator=(const cv::SparseMat&)':
> C:/OpenCV/include/opencv/cxmat.hpp:4081: error: `__exchange_and_add' undeclared (first use this function)
>
> C:/OpenCV/include/opencv/cxmat.hpp: In member function `void cv::SparseMat::addref()':
> C:/OpenCV/include/opencv/cxmat.hpp:4112: error: `__exchange_and_add' undeclared (first use this function)
> C:/OpenCV/include/opencv/cxmat.hpp: In member function `void cv::SparseMat::release()':
> C:/OpenCV/include/opencv/cxmat.hpp:4116: error: `__exchange_and_add' undeclared (first use this function)
>
> make.exe: *** [main.o] Error 1
>
> Execution terminated
>
>
>
> ------------------------------------
>
> Change settings: http://www.yahoogroups.com/mygroups, select
>    Get Emails (get all posts)
>    Daily Digest (one summary email per day)
>    Read on the web (read posts on the web only)Or Unsubscribe by mailing [hidden email]

Reply | Threaded
Open this post in threaded view
|

using FLANN with own tree

Paul Jones-5

I have been looking at FLANN and from it seems as if you can use it to quickly find nearest neighbour between two images, using a tree (if required). What I wanted to know is is there a more efficient way of using FLANN. For instance in the method mentioned, one would have to compare every image against every other image in order to find the best match. What if you had already built a kd-tree, is there a way to use flann on an existing tree?

Paul


     

[Non-text portions of this message have been removed]