title: FaceRecognizer in OpenCV
body: <p>I'm reading the article </p>
  
  <p><a href="http://docs.opencv.org/trunk/modules/contrib/doc/facerec/facerec_tutorial.html#conclusion" rel="nofollow">http://docs.opencv.org/trunk/modules/contrib/doc/facerec/facerec_tutorial.html#conclusion</a></p>
  
  <p>and try to run the code <code>facerec_lbph.cpp</code> . However, I ran into the following errors:</p>
  
  <pre><code>facerec_lbph.cpp:109:9: error: ‘FaceRecognizer’ was not declared in this scope
  facerec_lbph.cpp:109:23: error: template argument 1 is invalid
  facerec_lbph.cpp:109:31: error: invalid type in declaration before ‘=’ token
  facerec_lbph.cpp:109:58: error: ‘createLBPHFaceRecognizer’ was not declared in this scope
  facerec_lbph.cpp:110:10: error: base operand of ‘-&gt;’ is not a pointer
  facerec_lbph.cpp:113:31: error: base operand of ‘-&gt;’ is not a pointer
  facerec_lbph.cpp:132:10: error: base operand of ‘-&gt;’ is not a pointer
  facerec_lbph.cpp:136:27: error: base operand of ‘-&gt;’ is not a pointer
  facerec_lbph.cpp:144:18: error: base operand of ‘-&gt;’ is not a pointer
  facerec_lbph.cpp:145:18: error: base operand of ‘-&gt;’ is not a pointer
  facerec_lbph.cpp:146:18: error: base operand of ‘-&gt;’ is not a pointer
  facerec_lbph.cpp:147:18: error: base operand of ‘-&gt;’ is not a pointer
  facerec_lbph.cpp:148:18: error: base operand of ‘-&gt;’ is not a pointer
  facerec_lbph.cpp:151:35: error: base operand of ‘-&gt;’ is not a pointer
  </code></pre>
  
  <p>The OpenCV version is </p>
  
  <pre><code>opencv-2.3.1-3.fc16.x86_64
  opencv-python-2.3.1-3.fc16.x86_64
  opencv-devel-2.3.1-3.fc16.x86_64
  opencv-devel-docs-2.3.1-3.fc16.noarch
  </code></pre>
  
  <p>And the system version is fedora 16 which is 64 bits. The makefile I'm using is:</p>
  
  <pre><code>CC = g++
  
  SRC = facerec_lbph.cpp
  TARGET = main
  
  OBJS = facerec_lbph.o
  
  
  INCDIRS = -I/usr/include/opencv -I/usr/include/opencv2
  LIBDIRS = -L/usr/lib64
  
  CFLAGS = -g $(INCDIRS)
  LFLAGS = -lopencv_core -lopencv_highgui -lopencv_video -lopencv_imgproc -lopencv_objdetect -lopencv_ml -lopencv_contrib
  
  
  all: $(OBJS)
      $(CC) -o $(TARGET) $(OBJS) $(INCDIRS) $(LIBDIRS) $(LFLAGS)
  main.o: $(SRC) $(INCLUDE)
      $(CC) -c $(SRC) $(INCLUDE) $(INCDIRS) $(LIBDIRS) $(LFLAGS)
  
  clean:
      rm -f $(TARGET) $(OBJS) *.gch
  </code></pre>
  
  <p>And I can update the error report whenever new information is necessary. Thanks!</p>