title: Missing classes opencv
body: <p>I'm using opencv3.0.0 dev version with cmake.I installed opencv following this tutorial
  <a href="http://docs.opencv.org/trunk/doc/tutorials/introduction/linux_install/linux_install.html#linux-installation" rel="nofollow">http://docs.opencv.org/trunk/doc/tutorials/introduction/linux_install/linux_install.html#linux-installation</a></p>
  
  <p>After that I'm use the following cmake file to compile a simple face-detector:</p>
  
  <pre><code>cmake_minimum_required(VERSION 2.8)
  project( face-detect )
  find_package( OpenCV 3.0.0 EXACT REQUIRED )
  add_executable( face-detect face-detect.cpp )
  target_link_libraries( face-detect ${OpenCV_LIBS} )
  </code></pre>
  
  <p>Makefile is generated succefully, but when I compile the code there're missing classes under namespace cv:</p>
  
  <pre><code>face-detect.cpp:15: error: 'CommandLineParser' is not a member of 'cv'
       cv::CommandLineParser parser(argc, argv, keys);
       ^
  face-detect.cpp:23: error: invalid initialization of reference of type 'cv::InputArray {aka const cv::_InputArray&amp;}' from expression of type 'const char*'
     std::cout &lt;&lt; cv::format("Error: cannot load cascade file!\n");
  </code></pre>
  
  <p>However it does find cv::CascadeClassifier. How to fix this problem?</p>
  
  <p>This is the code for face-detect, I took it from internet:</p>
  
  <pre><code>#include &lt;opencv2/imgproc/imgproc.hpp&gt;
  #include &lt;opencv2/objdetect/objdetect.hpp&gt;
  #include &lt;opencv2/highgui/highgui.hpp&gt;
  #include &lt;iostream&gt;
  
  const char* keys = 
  {
      "{i|input| |The source image}"
      "{o|outdir| |The output directory}"
  };
  
  int main(int argc, const char** argv)
  {
      cv::CommandLineParser parser(argc, argv, keys);
      std::string infile = parser.get&lt;std::string&gt;("input");
      std::string outdir = parser.get&lt;std::string&gt;("outdir");
      std::string cascade_file = "haarcascade_frontalface_alt.xml";
  
      cv::CascadeClassifier cascade;
      if (cascade_file.empty() || !cascade.load(cascade_file))
      {
          std::cout &lt;&lt; cv::format("Error: cannot load cascade file!\n");
          return -1;
      }
  
      cv::Mat src = cv::imread(infile);
      if (src.empty())
      {
          std::cout &lt;&lt; cv::format("Error: cannot load source image!\n");
          return -1;
      }
  
      cv::Mat gray;
      cv::cvtColor(src, gray, CV_BGR2GRAY);
      cv::equalizeHist(gray, gray);
  
      std::vector&lt;cv::Rect&gt; faces;
      cascade.detectMultiScale(gray, faces, 1.2, 3);
  
      std::cout &lt;&lt; cv::format("0, %s (%dx%d)\n", infile.c_str(), src.cols, src.rows);
  
      cv::Mat src_copy = src.clone();
      for (int i = 0; i &lt; faces.size(); i++)
      {
          std::string outfile(cv::format("%s/face-%d.jpg", outdir.c_str(), i+1));
          cv::Rect r = faces[i];
          cv::rectangle(src, r, CV_RGB(0,255,0), 2);
          cv::imwrite(outfile, src_copy(r));
          cv::imwrite(infile, src);
          std::cout &lt;&lt; cv::format("%d, %s (%dx%d)\n", i+1, outfile.c_str(), r.width, r.height);
      }
  
      return 0;
  }
  </code></pre>