sqt兔斯基 2013-11-13 05:26 采纳率: 100%
浏览 1966
已采纳

vc读取位图编译出错。具体问题和代码如下

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;
}
}

  • 写回答

1条回答

  • Caesar Tang 2013-11-29 12:06
    关注

    m_dib = new ImageDib;
    左右类型不匹配,目测你是想new一个图片对象,但是类库里似乎没有

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 程序不包含适用于入口点的静态Main方法
  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记