Updated by Alexander Shishkov about 13 years ago
Hi!
Basically my problem is already described here: http://stackoverflow.com/questions/4763786/opencv-error-c2244/
When you turn on the compiler option @/analyze@ in Visual Studio 2008 or 2010 (go to Project properties, configuration, C/C++, Advanced, Code Analysis, yes (/analyze)), the project won't compile. You'll get these errors:
<pre>
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 (371)
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 (447)
</pre>
This is annoying, asyou cannot use Visual Studio's code analysis in projects that include OpenCV! [[OpenCV]]!
I could fix the first error. Line 365 in operations.hpp (OpenCV 2.2) was:
<pre>
<code class="cpp">
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)
</code></pre>
The fixed version is:
<pre>
<code class="cpp">
template<typename _Tp, int m, int n> inline
Matx<_Tp,m,n> Matx<_Tp,m,n>::diag(const diag_type& d)
</code></pre>
However, I couldn't fix the second error in line 447. I think fixing this would really benefit Visual Studio users.
Best regards,
Linus Atorf
Basically my problem is already described here: http://stackoverflow.com/questions/4763786/opencv-error-c2244/
When you turn on the compiler option @/analyze@ in Visual Studio 2008 or 2010 (go to Project properties, configuration, C/C++, Advanced, Code Analysis, yes (/analyze)), the project won't compile. You'll get these errors:
<pre>
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 (371)
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 (447)
</pre>
This is annoying, asyou cannot use Visual Studio's code analysis in projects that include OpenCV! [[OpenCV]]!
I could fix the first error. Line 365 in operations.hpp (OpenCV 2.2) was:
<pre>
<code class="cpp">
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)
</code></pre>
The fixed version is:
<pre>
<code class="cpp">
template<typename _Tp, int m, int n> inline
Matx<_Tp,m,n> Matx<_Tp,m,n>::diag(const diag_type& d)
</code></pre>
However, I couldn't fix the second error in line 447. I think fixing this would really benefit Visual Studio users.
Best regards,
Linus Atorf