Q:

how to add opencv to a gui QT application?

I created a new widget gui application in QT .
and in order to using opencv , I added INCLUDEPATH and LIBS to my projects as following :
QT       += core gui

greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

TARGET = testqt4
TEMPLATE = app

SOURCES += main.cpp\
        widget.cpp

INCLUDEPATH += C:/opencv/build/include

LIBS += -LC:\opencv\build\x64\vc12\lib
-lopencv_world310d

HEADERS  += widget.h

FORMS    += widget.ui

and I included my desired opencv headers as following :
#ifndef WIDGET_H
#define WIDGET_H

#include <QWidget>
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
....

but when I builded the project I encountered with this error :

can anyone help me to fix this error ?
thank you .

A:

Are you using qt creator? 
It will not update your makefile once you changed your .pro file.
Right click on the project folder in Projects view and click "Run qmake" should fix it.

