title: OpenCV - Error C2244
body: <p>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.</p>
  
  <p>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:</p>
  
  <pre><code>Error   3   error C2244: 'cv::Matx&lt;_Tp,,&gt;::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&lt;_Tp,,&gt;::diag' : unable to match function definition to an existing declaration   C:\Program Files\OpenCV2.2\include\opencv2\core\operations.hpp  448
  </code></pre>
  
  <p>which in turn shows me: </p>
  
  <p><code>template&lt;typename _Tp, int m, int n&gt; inline
  Matx&lt;_Tp,m,n&gt; Matx&lt;_Tp,m,n&gt;::diag(const Matx&lt;_Tp,MIN(m,n),1&gt;&amp; d)
  {
      Matx&lt;_Tp,m,n&gt; M;
      for(int i = 0; i &lt; MIN(m,n); i++)
          M(i,i) = d[i];
      return M;
  }</code></p>
  
  <p><code>template&lt;typename _Tp, int m, int n&gt; inline
  Matx&lt;_Tp, MIN(m,n), 1&gt; Matx&lt;_Tp, m, n&gt;::diag() const
  {
      diag_type d;
      for( int i = 0; i &lt; MIN(m, n); i++ )
          d.val[i] = val[i*n + i];
      return d;
  }</code></p>
  
  <p>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.</p>
  
  <p>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.</p>
  
  <p>Thanks,
  Jean-Pierre</p>