#include <gdiplus.h>导致错误 [英] #include &lt;gdiplus.h&gt; causes error

查看:48
本文介绍了#include <gdiplus.h>导致错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我在编译良好的程序中包含 gdiplus.h 时,我得到的第一个(有很多)错误是:

When I include gdiplus.h in a program that compiles well the first(there are many) error I get is:

c:\program files (x86)\microsoft sdks\windows\v7.0a\include\GdiplusImaging.h(77): error C2504: 'IUnknown' : base class undefined

GdiplusImaging.h 的一部分:

Part of GdiplusImaging.h:

IImageBytes : public IUnknown  <<< error!
{
public:
     ...

为什么会这样?这个 IUnknown 类在哪里?为什么它不在 GdiplusImaging.h 中?

Why it is so? Where is this IUnknown class? And why it's not in GdiplusImaging.h?

我的系统是 Windows7 x64.VisualStudio 2010.

My system is Windows7 x64. VisualStudio 2010.

包括部分:

#include <windows.h>
#include <gdiplus.h>
using namespace Gdiplus;
#pragma comment (lib, "gdiplus.lib")

推荐答案

这些是使用 GDI+ 的标准包含:

These are the standard includes for using GDI+:

#include <windows.h>
#include <objidl.h>
#include <gdiplus.h>
using namespace Gdiplus;
#pragma comment (lib,"Gdiplus.lib")

这篇关于#include <gdiplus.h>导致错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆