Some suggestions for OpenCV since you are a new user
- Skip the old C - api and move on to the new C++ - api which is much easier to use
- When encountering a problem, google is your best friend, this is somewhat the most tackled problem using OpenCV
- In your OpenCV folder there is a cpp folder under samples with tons of examples, including examples on facedetection
- Follow this guide and this guide for a sample program that runs perfectly