'opencv/cv.h' file not found when trying to compile ofxFaceTracker examples

I’m having trouble trouble compiling any of the ofxFaceTracker examples. I always end up getting this error.

I’ve tried solutions posted on similar questions.

#include <opencv/cv.h>
-results in: ‘opencv/cv.h’ file not found


Just a litle follow-up.

I have experimented with the correct folder on xcode’s header and library search paths. And figured out that I can’t really find the actual file cv.h anywhere on when I search with all of the subfolders of my usr dir.

Could it be that I have not installed openCV properly? I’d really appreciate any insights please :slight_smile:

Hi @blaskretti
Welcome to the forum!

Can you try using the project generator that comes in the of download to generate the ofxFaceTracker example.

You can use the Update option in the PG and select the example folder and it should add ofxOpenCV addon which will include OpenCV. If it doesn’t automatically you can add it from the addon drop down in the project generator.

As long as you include the ofxOpenCV addon the cv includes should resolve.

Hope that helps.

Thank you! I have done what you said, and as you see I have added the correct addons, but I still get the same error. Attaching some screenshots, I really appreciate the help :slightly_smiling_face:

Thank you


What Xcode version and macOS are you on?

Does the openCvExample in examples/computer_vision/opencvExample work for you?
btw if you just want to detect faces the opencvHaarFinderExample does that too.


I’m on mojave, and xcode 11.3.1, yes the opencvExample works perfectly, I need facetracking for my project, but I can confirm that opencvHaarFinderExample runs.

I just tested on all the ofxFaceTracker examples, and I get the same error on all of them.


This might not be so easy to solve if you are using the latest openframeworks:

it’s because ofxFaceTracker is based on old version of opencv. oF 0.11.0 use opencv4.

you can use ofxFaceTracker2, which is working with 0.11.0. also there’s ofxFaceTracker2 by @bakercp with ofxDlib.


Thanks you @icq4ever everything makes sense now :slight_smile:

1 Like