title: How install header files for opencv in C in my ubuntu 11.10
body: <p>Resently I'm installed Opencv in my machine. Its working in python well(I just checked it by some eg programs). But due to the lack of tutorials in python I decided to move to c. I just run an Hello world program from <a href="http://www.cs.iit.edu/~agam/cs512/lect-notes/opencv-intro/" rel="nofollow">http://www.cs.iit.edu/~agam/cs512/lect-notes/opencv-intro/</a></p>
  
  <p>My program is</p>
  
  <pre><code>#include &lt;stdlib.h&gt;
  #include &lt;stdio.h&gt;
  #include &lt;math.h&gt;
  #include &lt;cv.h&gt;
  #include &lt;highgui.h&gt;
  
  
  int main(int argc, char *argv[])
  {
    IplImage* img = 0; 
    int height,width,step,channels;
    uchar *data;
    int i,j,k;
  
    if(argc&lt;2){
      printf("Usage: main &lt;image-file-name&gt;\n\7");
      exit(0);
    }
  
    // load an image  
    img=cvLoadImage(argv[1]);
    if(!img){
      printf("Could not load image file: %s\n",argv[1]);
      exit(0);
    }
  
    // get the image data
    height    = img-&gt;height;
    width     = img-&gt;width;
    step      = img-&gt;widthStep;
    channels  = img-&gt;nChannels;
    data      = (uchar *)img-&gt;imageData;
    printf("Processing a %dx%d image with %d channels\n",height,width,channels); 
  
    // create a window
    cvNamedWindow("mainWin", CV_WINDOW_AUTOSIZE); 
    cvMoveWindow("mainWin", 100, 100);
  
    // invert the image
    for(i=0;i&lt;height;i++) for(j=0;j&lt;width;j++) for(k=0;k&lt;channels;k++)
      data[i*step+j*channels+k]=255-data[i*step+j*channels+k];
  
    // show the image
    cvShowImage("mainWin", img );
  
    // wait for a key
    cvWaitKey(0);
  
    // release the image
    cvReleaseImage(&amp;img );
    return 0;
  }
  </code></pre>
  
  <p>first while compiling I got the following error</p>
  
  <pre><code>hello-world.c:4:16: fatal error: cv.h: No such file or directory
  compilation terminated.
  </code></pre>
  
  <p>and I rectify this error by compiling like this</p>
  
  <pre><code>gcc -I/usr/lib/perl/5.12.4/CORE -o hello-world hello-world.c
  </code></pre>
  
  <p>But now the error is</p>
  
  <pre><code> In file included from hello-world.c:4:0:
  /usr/lib/perl/5.12.4/CORE/cv.h:14:5: error: expected specifier-qualifier-list before ‘_XPV_HEAD’
   hello-world.c:5:21: fatal error: highgui.h: No such file or directory
   compilation terminated.
  </code></pre>
  
  <p>Qns : 
       Is it this header is not installed in my system? While I'm using this command find /usr -name "highgui.h" I'm not find anything
       If this header is not in my sysytem hoew I install this?</p>
  
  <p>Please help me . I'm new in opencv</p>