Qt – INCLUDEPATH in qmake project file doesn’t work

qmakeqtqt-creator

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?

Best Answer

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')

Related Topic