[C++ Error] GdiplusGraphics.h(34): E2015 Ambiguity between 'Gdiplus::Graphics::Graphics(void *)' and 'Gdiplus::Graphics::Graphic
来源:互联网 发布:修改淘宝销量方法 编辑:程序博客网 时间:2024/05/15 08:22
今天遇到这个问题
在网上找到一篇
http://blog.k-res.net/?paged=13
一下为引用:
加了Gdiplus.h后,编译不能通过,提示[C++ Error] GdiplusGraphics.h(37): E2015 Ambiguity between ‘Gdiplus::Graphics::Graphics(void *)’ and ‘Gdiplus::Graphics::Graphics(void *,int)’
这个是CodeGear提到的一个已知问题:
Must Turn off NO_STRICT #define with GdiPlus library
The C++ library GdiPlus cannot be used in non STRICT mode, since it requires that Graphics::Graphics(HDC) be distinguishable from Graphics::Graphics(HWND). In non STRICT mode, both HWND and HDC are “void*”. Otherwise, you get the error:
[C++ Error] GdiplusGraphics.h(37): E2015 Ambiguity between ‘Gdiplus::Graphics::Graphics(void *)’ and ‘Gdiplus::Graphics::Graphics(void *,int)’
解决办法就是在Project->Options里的Paths and Defines的Conditional Defines里面加上STRICT,这样就开启了STRICT模式,那个歧义就可以消除了!
我的环境是2006,
1、加入头文件
#include <Gdiplus.h>
2、加入预编译命令
#pragma link "gdiplus.lib"
3、option->c++ compling->paths and defines里的conditional defines 里加上 STRICT
就ok了
还要注意的就是有名字空间,该加上的要加上Gdiplus::
- [C++ Error] GdiplusGraphics.h(34): E2015 Ambiguity between 'Gdiplus::Graphics::Graphics(void *)' and 'Gdiplus::Graphics::Graphic
- c++builder E2015 Ambiguity between ‘Gdiplus::Graphics::Graphics(void *)’ and ‘Gdiplus::Graphics::Graphics(void *,int)’
- 使用Gdiplus::Graphics时要注意一个问题
- graphics.h
- graphics.h
- graphics.h
- graphics.h
- graphics
- Graphics
- Graphics
- Graphics
- graphics
- graphics
- Graphics
- Graphics
- Graphics
- Graphics
- Graphics
- 坐办公室应该熟练的键盘操作
- JavaScript去除空格的三种方法 (trim)
- Herve leger sell Cai Cuirong who in the end
- JAVA数据类型的互相转换
- 中国最美的100句古典古诗词
- [C++ Error] GdiplusGraphics.h(34): E2015 Ambiguity between 'Gdiplus::Graphics::Graphics(void *)' and 'Gdiplus::Graphics::Graphic
- Eclipse3.2安装及汉化过程
- Kconfig添加了MODULE,然后在make menuconfig中找不到选项
- Haskell 几乎无痛苦上手指
- 创业靠激情守业靠制度
- Oracle 11g SELinux原因启动失败的解决办法
- 简单实现设计模式
- HTML 4.0 学习篇上
- 教你三分钟看穿他/她的人品