title: No such file or directory error when compiling C++ file with OpenCV headers
body: <p>I'm on Red Hat Linux. I'm having some (probably newbie) problem with the includes in a C++ file. I created the following simple OpenCV script,</p>
  
  <pre><code>#include "opencv2/highgui/highgui.hpp"
  using namespace cv;
  
  int main(int argc, char ** argv){
      Mat img = imread( argv[1], -1 );
      if ( img.empty() ) return -1;
      namedWindow( "Example1", cv::WINDOW_AUTOSIZE );
      imshow( "Example1", img );
      waitKey( 0 );
      destroyWindow( "Example1" );
  }
  </code></pre>
  
  <p>Then in the terminal I entered</p>
  
  <pre><code>g++ my_simple_script.cpp
  </code></pre>
  
  <p>and got the errors</p>
  
  <pre><code>newfile.cpp:1:39: error: opencv2/highgui/highgui.hpp: No such file or directory
  newfile.cpp:3: error: 'cv' is not a namespace-name
  newfile.cpp:3: error: expected namespace-name before ';' token
  newfile.cpp: In function 'int main(int, char**)':
  newfile.cpp:6: error: 'Mat' was not declared in this scope
  newfile.cpp:6: error: expected ';' before 'img'
  newfile.cpp:7: error: 'img' was not declared in this scope
  newfile.cpp:8: error: 'cv' has not been declared
  newfile.cpp:8: error: 'namedWindow' was not declared in this scope
  newfile.cpp:9: error: 'img' was not declared in this scope
  newfile.cpp:9: error: 'imshow' was not declared in this scope
  newfile.cpp:10: error: 'waitKey' was not declared in this scope
  newfile.cpp:11: error: 'destroyWindow' was not declared in this scope
  </code></pre>
  
  <p>I added</p>
  
  <pre><code>/home/m/maxwell9/2.4.3/include
  </code></pre>
  
  <p>to my PATH, where 2.4.3 indicates the version of OpenCV I'm using.
  When I type</p>
  
  <pre><code>echo $PATH
  </code></pre>
  
  <p>I see</p>
  
  <pre><code>/opt/apps/jdk1.6.0_22.x64/bin:/apps/smlnj/110.74/bin:/usr/local/cuda/bin:/sbin:/bin:/usr/sbin:/usr/bin:/apps/weka/3.7.12:/home/m/maxwell9/bin:/home/m/maxwell9/2.4.3/include
  </code></pre>
  
  <p>I confirmed that there is a file at </p>
  
  <pre><code>/home/m/maxwell9/2.4.3/include/opencv2/highgui/highgui.hpp
  </code></pre>