INCLUDEPATH in qmake project file doesn't work

user2794529 picture user2794529 · Sep 27, 2013 · Viewed 45.3k times · Source

I've got a problem with include in a qmake project. In my .pro file I've got:

INCLUDEPATH += "C:\OpenCV\build\include"

and in my cpp :

#include <opencv\cv.h>

The compiler indicates an error:

Cannot open include file: 'opencv\cv.h': No such file or directory

but if I write this in my cpp:

#include "C:\OpenCV\build\include\opencv\cv.h"

it works!

I build the project from within Qt Creator. What am I doing wrong?

Answer

Steve James picture Steve James · Dec 24, 2014

You have to run qmake(build->run qmake) to validate changes in the pro file. Qt creator Adding external library (still: Cannot open include file: 'GL/glew.h')