compilation error when #include opencv.h with vs2010

asked 2014-11-22 16:07:02 -0600

ido gravatar image

Hi, I'm using vs2010 and openCV2.4.9

When I add to a project the line

#include <opencv\cv.h>

I get the following error:

1>d:\opencv\opencv2.4.9\build\include\opencv2\flann\any.h(70): error C2061: syntax error : identifier 'dest' 1> d:\opencv\opencv2.4.9\build\include\opencv2\flann\any.h(69) : while compiling class template member function 'void cvflann::anyimpl::small_any_policy<t>::copy_from_value(const void ,void *)' 1> with 1> [ 1> T=const char * 1> ] 1> d:\opencv\opencv2.4.9\build\include\opencv2\flann\any.h(157) : see reference to class template instantiation 'cvflann::anyimpl::small_any_policy<t>' being compiled 1> with 1> [ 1> T=const char * 1> ] 1> d:\opencv\opencv2.4.9\build\include\opencv2\flann\any.h(217) : see reference to function template instantiation 'cvflann::anyimpl::base_any_policy *cvflann::anyimpl::get_policy<t>(void)' being compiled 1> with 1> [ 1> T=const char * 1> ] 1> d:\opencv\opencv2.4.9\build\include\opencv2\flann\any.h(187) : see reference to function template instantiation 'cvflann::any &cvflann::any::assign<const char*="">(const T &)' being compiled 1> with 1> [ 1> T=const char * 1> ]

Please advice.

edit retag flag offensive close merge delete

Comments

How come i have no views for this question?

ido gravatar imageido ( 2014-11-23 12:01:24 -0600 )edit

please try to include "opencv2/opencv..hpp" instead of the deprecated c-headers.

berak gravatar imageberak ( 2014-11-24 02:03:57 -0600 )edit

Above answer really worked. Thanx a lot!!

Premchand gravatar imagePremchand ( 2017-02-09 03:45:54 -0600 )edit