While writing code I observed that if i declare unmanaged classs before managed class the code compiles with no error:
#include <opencv2\core\core.hpp>
#include <opencv2\imgproc\imgproc.hpp>
#include <opencv2\highgui\highgui.hpp>
using namespace System;
namespace OpenCVDll
{
public class OpenCV
{
public:
//members
cv::Mat CalibrationDark;
cv::Mat CalibrationBright;
unsigned short* dark;
unsigned short* bright;
//methods
void DarkCalibration();
void BrightCalibration();
OpenCV(){}
~OpenCV();
};
public ref class MOpenCV
{
public:
//members
OpenCV* UOpenCV;
//methods
MOpenCV();
!MOpenCV();
~MOpenCV();
private:
//methods
void Destruction();
};
}`
However if I declare the classes other way around, first managed and then unmanaged:
#include <opencv2\core\core.hpp>
#include <opencv2\imgproc\imgproc.hpp>
#include <opencv2\highgui\highgui.hpp>
using namespace System;
namespace OpenCVDll
{
public ref class MOpenCV
{
public:
//members
OpenCV* UOpenCV;
//methods
MOpenCV();
!MOpenCV();
~MOpenCV();
private:
//methods
void Destruction();
};
public class OpenCV
{
public:
//members
cv::Mat CalibrationDark;
cv::Mat CalibrationBright;
unsigned short* dark;
unsigned short* bright;
//methods
void DarkCalibration();
void BrightCalibration();
OpenCV(){}
~OpenCV();
};
}
I get missing type error: error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
Why is it so?