我使用的是visual studio professional 2013.我使用opencv。我已正确链接所有opencv库。
我该如何解决这个问题?
请在下面找到我使用的代码(这个未定义的Mat问题不会发生在main.cpp中)
#pragma once
#include "stdafx.h"
#include <opencv2/highgui/highgui.hpp> // import no include errors
#include <opencv2/imgproc/imgproc.hpp> // import no include errors
#include <opencv2/core/core.hpp> // import no include errors
class DepthImage
{
public:
DepthImage();
~DepthImage();
private:
Mat image; //identifier "Mat" is undefined
};
答案 0 :(得分:4)
#pragma once
//#include "stdafx.h" never in header file
#include <opencv2/highgui/highgui.hpp> // import no include errors
#include <opencv2/imgproc/imgproc.hpp> // import no include errors
#include <opencv2/core/core.hpp> // import no include errors
class DepthImage
{
public:
DepthImage();
~DepthImage();
private:
cv::Mat image; //no more identifier "Mat" is undefined
};
希望能帮到你