GDI+在Win32项目(非MFC)中编译出错处理

     今天,看到段代码是关于贴图的,在win32SDK环境下的实现。于是我想利用GDI+把这段代码整合下,就创建了个win32项目想到生成的程序,然后再stdafx.h最后加上:

  1. #include <gdiplus.h>
  2. using namespace Gdiplus;
  3. #pragma comment(lib,"GdiPlus")

可是,编译的时候出了一大堆错误--

1>stdafx.cpp
1>f:/program files/microsoft visual studio 8/vc/platformsdk/include/GdiplusImaging.h(67) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>f:/program files/microsoft visual studio 8/vc/platformsdk/include/GdiplusImaging.h(67) : error C2440: 'initializing' : cannot convert from 'const char [37]' to 'int'
1>        There is no context in which this conversion is possible

 

。。。。。。

我赶紧查MSDN,发现给出的实例根本没谈编译错误之类的话题,无果!

后来仔细看了看错误信息,估计是头文件顺序错了,可又不知道具体在哪?Google了下,有两种解决办法,但都没说具体原因~哎,看来又是MS~

 

    错误的解决办法:

    1.在stdafx.h中去掉WIN32_LEAN_AND_MEAN的定义
    2.在stdafx.h中包含#include <comdef.h>

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值