hmm, shervin is great, but that code is a bit old.
the opencv api moved to c++ in the meantime, it has a proper facerecognition out of the box now, and also there seem to be some 'win32 special' functions hidden in that code.
maybe you might want to take a look here: https://github.com/MasteringOpenCV/code/tree/master/Chapter8_FaceRecognition
for a slightly fresher version