here is the code below:
Qt Code:
  1. const char *filename="C://OpenCV2.2//data//haarcascades//haarcascade_frontalface_alt.xml";
  2. cascade = ( CvHaarClassifierCascade* )cvLoad(filename,0,0,0);
  3. if( !cascade )
  4. {
  5. fprintf( stderr, "ERROR: Could not load classifier cascade\n" );
  6. return -1;
  7. }
  8. storage=cvCreateMemStorage(0);
  9. capture=cvCaptureFromCAM(0);
  10. // assert( cascade && storage && capture );
  11. IplImage* frame= cvQueryFrame(capture);
  12. m_i=QImage(QSize(frame->width,frame->height),QImage::Format_RGB888);
  13. ui->frame->setMinimumSize(m_i.width(),m_i.height());
  14. ui->frame->setMaximumSize(ui->frame->minimumSize());
  15.  
  16. m_opencvimg=cvCreateImageHeader(cvSize(m_i.width(),m_i.height()),8,3);
  17. m_opencvimg->imageData=(char*)m_i.bits();
  18.  
  19. if(frame->origin== IPL_ORIGIN_TL)
  20. cvCopy(frame,m_opencvimg,0);
  21. else
  22. cvFlip(frame,m_opencvimg,0);
  23.  
  24. cvCvtColor(m_opencvimg,m_opencvimg,CV_BGR2RGB);
  25.  
  26. m_timer=new QTimer(this);
  27. connect(m_timer,SIGNAL(timeout()),this,SLOT(queryFrame()));
  28. m_timer->start(50);
To copy to clipboard, switch view to plain text mode 


Error's i was getting while compiling this code:

C:/Users/mind_freak/facedetect-build-desktop/../facedetect/widget.cpp:15: error: returning a value from a constructor

i dont know i have given the correct path to the xml file but unable to load.

help me out of this....i am stuck with this....

thanks..