Compiling...
demo1Doc.cpp
E:\C++練習\數字圖像模式識別\demo\demo1\demo1Doc.cpp(33) : error C2679: binary '=' : no operator defined which takes a right-hand operand of type 'class ImageDib *' (or there is no acceptable conversion)
E:\C++練習\數字圖像模式識別\demo\demo1\demo1Doc.cpp(39) : error C2678: binary '!=' : no operator defined which takes a left-hand operand of type 'class ImageDib' (or there is no acceptable conversion)
E:\C++練習\數字圖像模式識別\demo\demo1\demo1Doc.cpp(41) : error C2440: 'delete' : cannot convert from 'class ImageDib' to ''
No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
E:\C++練習\數字圖像模式識別\demo\demo1\demo1Doc.cpp(41) : fatal error C1903: unable to recover from previous error(s); stopping compilation
Error executing cl.exe.
demo1.exe - 4 error(s), 0 warning(s)
!定位到代碼中,貌似是這一部分出了問題:
CDemo1Doc::CDemo1Doc()
{
// TODO: add one-time construction code here
m_dib = new ImageDib;
}
CDemo1Doc::~CDemo1Doc()
{
if (m_dib != NULL)
{
delete m_dib;
m_dib = 0;
}
}
m_dib = new ImageDib;
左右類型不匹配,目測你是想new一個圖片對象,但是類庫裡似乎沒有