title: Opencv Variables not declared in this scope
body: <p>I've just started to try opencv. And have run the program successfully on my another computher(have two computers).</p>
  
  <p>I've followed the same installation steps as the computer that have built successfully, but it isn't work it prompt up the error message below, after I've <code>cmake</code> and <code>make</code> to build the project.</p>
  
  <p>Testing this example here on the official site:
  <a href="http://docs.opencv.org/doc/tutorials/imgproc/histograms/template_matching/template_matching.html#code" rel="nofollow">http://docs.opencv.org/doc/tutorials/imgproc/histograms/template_matching/template_matching.html#code</a></p>
  
  <pre><code>/home/howard/Documents/opencv/opencv-sample/template_match/template_match.cpp:11:22: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
   char* image_window = "Source Image";
                        ^
  /home/howard/Documents/opencv/opencv-sample/template_match/template_match.cpp:12:23: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
   char* result_window = "Result window";
                         ^
  /home/howard/Documents/opencv/opencv-sample/template_match/template_match.cpp: In function ‘int main(int, char**)’:
  /home/howard/Documents/opencv/opencv-sample/template_match/template_match.cpp:28:30: error: ‘CV_WINDOW_AUTOSIZE’ was not declared in this scope
     namedWindow( image_window, CV_WINDOW_AUTOSIZE );
                                ^
  /home/howard/Documents/opencv/opencv-sample/template_match/template_match.cpp:32:26: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
     char* trackbar_label = "Method: \n 0: SQDIFF \n 1: SQDIFF NORMED \n 2: TM CCORR \n 3: TM CCORR NORMED \n 4: TM COEFF \n 5: TM COEFF NORMED";
                            ^
  /home/howard/Documents/opencv/opencv-sample/template_match/template_match.cpp: In function ‘void MatchingMethod(int, void*)’:
  /home/howard/Documents/opencv/opencv-sample/template_match/template_match.cpp:68:24: error: ‘CV_TM_SQDIFF’ was not declared in this scope
     if( match_method  == CV_TM_SQDIFF || match_method == CV_TM_SQDIFF_NORMED )
                          ^
  /home/howard/Documents/opencv/opencv-sample/template_match/template_match.cpp:68:56: error: ‘CV_TM_SQDIFF_NORMED’ was not declared in this scope
     if( match_method  == CV_TM_SQDIFF || match_method == CV_TM_SQDIFF_NORMED )
                                                          ^
  make[2]: *** [CMakeFiles/template_match.dir/template_match.cpp.o] Error 1
  make[1]: *** [CMakeFiles/template_match.dir/all] Error 2
  make: *** [all] Error 2
  </code></pre>
  
  <p>Do any one know what's happening and how could I fix it?</p>