Home:ALL Converter>OpenCV - Error C2244

OpenCV - Error C2244

Ask Time:2011-01-22T05:03:34         Author:Jean-Pierre

Json Formatter

I'm currently on vacation far away from my desktop, however I wanted to practice my c++ in particular with openCV, so I brought my laptop along. Given time and family constraints I didn't get everything set up in time with the libraries before flying.

I've set everything up with regards to VS 2010 as I recall doing on my desktop a while ago, but on compiling the test example on the openCV website (http://opencv.willowgarage.com/wiki/VisualC%2B%2B) I receive the following errors:

Error   3   error C2244: 'cv::Matx<_Tp,,>::diag' : unable to match function definition to an existing declaration   C:\Program Files\OpenCV2.2\include\opencv2\core\operations.hpp  372
Error   4   error C2244: 'cv::Matx<_Tp,,>::diag' : unable to match function definition to an existing declaration   C:\Program Files\OpenCV2.2\include\opencv2\core\operations.hpp  448

which in turn shows me:

template<typename _Tp, int m, int n> inline Matx<_Tp,m,n> Matx<_Tp,m,n>::diag(const Matx<_Tp,MIN(m,n),1>& d) { Matx<_Tp,m,n> M; for(int i = 0; i < MIN(m,n); i++) M(i,i) = d[i]; return M; }

template<typename _Tp, int m, int n> inline Matx<_Tp, MIN(m,n), 1> Matx<_Tp, m, n>::diag() const { diag_type d; for( int i = 0; i < MIN(m, n); i++ ) d.val[i] = val[i*n + i]; return d; }

I've looked into this error on the msdn and have looked on the openCV forums, but I couldn't find record of this specific error and I'm not sure how to resolve it.

Is it also problematic that I'm running the 64 bit version of Windows 7? I read that openCV2.2 is compatible however previously while the programs would compile, it kept on saying the .dll files were missing even though the PATH variable and directories were correct.

Thanks, Jean-Pierre

Author:Jean-Pierre,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/4763786/opencv-error-c2244
user737903 :

I had the same issue running Opencv2.2 on 32bit Win7 VS2010 and QT 4.7.2.\n\nI doesn't seem to be an error that affects the actual function of code. When I turned code analysis off as Himanshu jain described above it fixed the problem.",
2011-05-04T11:53:14
yy