title: ‘true’ undeclared (first use in this function) in opencv
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/1921539/using-boolean-values-in-c">Using boolean values in C</a>  </p>
  </blockquote>
  
  
  
  <p>I am newbie to C and want to write a program that will detect face from web cam, I got one on line,I am using opencv-2.4.3 on eclipse CDT, I searched on line for the solution but did not get the appropriate solution for my problem so posting it as new question.Here is the code:</p>
  
  <pre><code> // Include header files
   #include "/home/OpenCV-2.4.3/include/opencv/cv.h"
   #include "/home/OpenCV-2.4.3/include/opencv/highgui.h"
   #include "stdafx.h"
  
   int main(){
  
  //initialize to load the video stream, find the device
   CvCapture *capture = cvCaptureFromCAM( 0 );
  if (!capture) return 1;
  
  //create a window
  cvNamedWindow("BLINK",1);
  
   while (true){
      //grab each frame sequentially
      IplImage* frame = cvQueryFrame( capture );
      if (!frame) break;
  
      //show the retrived frame in the window
      cvShowImage("BLINK", frame);
  
      //wait for 20 ms
      int c = cvWaitKey(20);
  
      //exit the loop if user press "Esc" key
      if((char)c == 27 )break;
  }
   //destroy the opened window
  cvDestroyWindow("BLINK");
  
  //release memory
  cvReleaseCapture(&amp;capture);
  return 0;
   }
  </code></pre>
  
  <p>And I am getting error as true’ undeclared (first use in this function), It is causing problem in while loop, I read it is not good practise to use while(true) but how should I go about. Can anybody hellp me out.</p>