Beginner Q - declared variable in header, but doesn't register in .cpp file
-
I was following a tutorial from here:
"youtube vid":http://www.youtube.com/watch?v=0ONxIy8itRAWhen I run it, I get a lot of undeclared identifiers.
This is a condensed version of the code,
In my header file I have: (dialog.h)
@#ifndef DIALOG_H
#define DIALOG_H#include <QTCore>
#include <QDialog>#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>private:
cv::Mat matOriginal; // these 2 variables get "undeclared identifier" error in cpp file.
cv::Mat matProcessed;
@in my dialog.cpp file:
@#include "dialog.h"
#include "ui_dialog.h"
#include <QtCore>
#include <opencv2\opencv.hpp>
#include "opencv2/imgproc/imgproc.hpp"
#include "opencv2/highgui/highgui.hpp"void Dialog::processFrameandUpdateGUI() {
cv::inRange(matOriginal, cv::Scalar(0,0,175), Scalar(100,100,256), matProcessed);
cv::GaussianBlur(matProcessed, matProcessed, cv::Size(9,9), 1.5);
@The last 2 lines is where I get an undeclared identifier error in matOriginal and matProcessed. This is happening to all the variables in my program, so I think I'm doing something fundamentally wrong.
From what I can tell, the variables are being declared in the header file, which is linked to the cpp file, where I use the variable. Anybody have any suggestions? Thanks