gpt4 book ai didi

c++ - visual studio c++ 2010 express 使用 gdi 时出错

转载 作者:行者123 更新时间:2023-12-02 17:54:42 26 4
gpt4 key购买 nike

好的,我只是将它升级到 visual studio c++ 2010 express。当我使用 gdi+ 时,我得到的错误不是在我的文件中,而是在 gdi+ 头文件中错误之一是这个c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gdiplusimaging.h(74):错误 C4430:缺少类型说明符 - 假定为 int。注意:C++不支持default-int

这是我使用的gdi代码

VOID OnPaint(HWND hWnd){    GRAPHICS draw;    SolidBrush brush(Color(0, 0, 0, 255));    draw.FillEclipse(&brush, 0, 0, 25, 25);}

使用 vs 2008 它工作正常
..................................................... ......................编辑

这是错误列表

1>  stdafx.cpp1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gdiplusimaging.h(74): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gdiplusimaging.h(74): error C2440: 'initializing' : cannot convert from 'const char [37]' to 'int'1>          There is no context in which this conversion is possible1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gdiplusimaging.h(74): error C2146: syntax error : missing ';' before identifier 'IImageBytes'1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gdiplusimaging.h(74): error C2470: 'IImageBytes' : looks like a function definition, but there is no parameter list; skipping apparent body1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gdiplusimaging.h(74): error C2059: syntax error : 'public'1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gdiplusimaging.h(280): error C2146: syntax error : missing ';' before identifier 'id'1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gdiplusimaging.h(280): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gdiplusimaging.h(280): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gdiplusheaders.h(384): error C2061: syntax error : identifier 'IStream'1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gdiplusheaders.h(395): error C2061: syntax error : identifier 'IStream'1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gdiplusheaders.h(405): error C2061: syntax error : identifier 'IStream'1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gdiplusheaders.h(443): error C2061: syntax error : identifier 'PROPID'1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gdiplusheaders.h(444): error C2061: syntax error : identifier 'PROPID'1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gdiplusheaders.h(445): error C2061: syntax error : identifier 'PROPID'1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gdiplusheaders.h(453): error C2061: syntax error : identifier 'PROPID'1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gdiplusheaders.h(471): error C2535: 'Gdiplus::Image::Image(void)' : member function already defined or declared1>          c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gdiplusheaders.h(384) : see declaration of 'Gdiplus::Image::Image'1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gdiplusheaders.h(505): error C2061: syntax error : identifier 'IStream'1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gdiplusheaders.h(516): error C2061: syntax error : identifier 'IStream'1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gdiplusheaders.h(758): error C2061: syntax error : identifier 'IStream'1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gdiplusheaders.h(813): error C2061: syntax error : identifier 'IStream'1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gdiplusheaders.h(813): error C2535: 'Gdiplus::Metafile::Metafile(void)' : member function already defined or declared1>          c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gdiplusheaders.h(758) : see declaration of 'Gdiplus::Metafile::Metafile'1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gdiplusheaders.h(820): error C2061: syntax error : identifier 'IStream'1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gdiplusheaders.h(820): error C2535: 'Gdiplus::Metafile::Metafile(void)' : member function already defined or declared1>          c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gdiplusheaders.h(758) : see declaration of 'Gdiplus::Metafile::Metafile'1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gdiplusheaders.h(829): error C2061: syntax error : identifier 'IStream'1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gdiplusheaders.h(829): error C2535: 'Gdiplus::Metafile::Metafile(void)' : member function already defined or declared1>          c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gdiplusheaders.h(758) : see declaration of 'Gdiplus::Metafile::Metafile'1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gdiplusheaders.h(855): error C2061: syntax error : identifier 'IStream'1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gdiplusheaders.h(923): error C2535: 'Gdiplus::Metafile::Metafile(void)' : member function already defined or declared1>          c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gdiplusheaders.h(758) : see declaration of 'Gdiplus::Metafile::Metafile'1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gdiplusflat.h(1133): error C2065: 'IStream' : undeclared identifier1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gdiplusflat.h(1133): error C2065: 'stream' : undeclared identifier1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gdiplusflat.h(1133): error C2065: 'image' : undeclared identifier1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gdiplusflat.h(1133): error C2275: 'Gdiplus::GpImage' : illegal use of this type as an expression1>          c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gdiplusgpstubs.h(61) : see declaration of 'Gdiplus::GpImage'1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gdiplusflat.h(1133): warning C4229: anachronism used : modifiers on data are ignored1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gdiplusflat.h(1133): error C2078: too many initializers1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gdiplusflat.h(1139): error C2065: 'IStream' : undeclared identifier1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gdiplusflat.h(1139): error C2065: 'stream' : undeclared identifier1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gdiplusflat.h(1139): error C2065: 'image' : undeclared identifier1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gdiplusflat.h(1139): error C2275: 'Gdiplus::GpImage' : illegal use of this type as an expression1>          c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gdiplusgpstubs.h(61) : see declaration of 'Gdiplus::GpImage'1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gdiplusflat.h(1139): warning C4229: anachronism used : modifiers on data are ignored1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gdiplusflat.h(1139): error C2078: too many initializers1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gdiplusflat.h(1156): error C2061: syntax error : identifier 'IStream'1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gdiplusflat.h(1244): error C2061: syntax error : identifier 'PROPID'1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gdiplusflat.h(1247): error C2061: syntax error : identifier 'PROPID'1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gdiplusflat.h(1250): error C2061: syntax error : identifier 'PROPID'1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gdiplusflat.h(1262): error C2061: syntax error : identifier 'PROPID'1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gdiplusflat.h(1286): error C2065: 'IStream' : undeclared identifier1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gdiplusflat.h(1286): error C2065: 'stream' : undeclared identifier1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gdiplusflat.h(1286): error C2065: 'bitmap' : undeclared identifier1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gdiplusflat.h(1286): error C2275: 'Gdiplus::GpBitmap' : illegal use of this type as an expression1>          c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gdiplusgpstubs.h(62) : see declaration of 'Gdiplus::GpBitmap'1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gdiplusflat.h(1286): warning C4229: anachronism used : modifiers on data are ignored1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gdiplusflat.h(1286): error C2078: too many initializers1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gdiplusflat.h(1292): error C2065: 'IStream' : undeclared identifier1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gdiplusflat.h(1292): error C2065: 'stream' : undeclared identifier1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gdiplusflat.h(1292): error C2065: 'bitmap' : undeclared identifier1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gdiplusflat.h(1292): error C2275: 'Gdiplus::GpBitmap' : illegal use of this type as an expression1>          c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gdiplusgpstubs.h(62) : see declaration of 'Gdiplus::GpBitmap'1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gdiplusflat.h(1292): warning C4229: anachronism used : modifiers on data are ignored1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gdiplusflat.h(1292): error C2078: too many initializers1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gdiplusflat.h(2222): error C2065: 'IStream' : undeclared identifier1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gdiplusflat.h(2222): error C2065: 'stream' : undeclared identifier1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gdiplusflat.h(2224): error C2065: 'header' : undeclared identifier1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gdiplusflat.h(2224): error C2275: 'Gdiplus::MetafileHeader' : illegal use of this type as an expression1>          c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gdiplusmetaheader.h(112) : see declaration of 'Gdiplus::MetafileHeader'1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gdiplusflat.h(2224): warning C4229: anachronism used : modifiers on data are ignored1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gdiplusflat.h(2224): error C2078: too many initializers1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gdiplusflat.h(2242): error C2061: syntax error : identifier 'IStream'1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gdiplusflat.h(2262): error C2065: 'IStream' : undeclared identifier1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gdiplusflat.h(2262): error C2065: 'stream' : undeclared identifier1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gdiplusflat.h(2262): error C2065: 'metafile' : undeclared identifier1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gdiplusflat.h(2262): error C2275: 'Gdiplus::GpMetafile' : illegal use of this type as an expression1>          c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gdiplusgpstubs.h(63) : see declaration of 'Gdiplus::GpMetafile'1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gdiplusflat.h(2262): warning C4229: anachronism used : modifiers on data are ignored1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gdiplusflat.h(2262): error C2078: too many initializers1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gdiplusflat.h(2309): error C2065: 'IStream' : undeclared identifier1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gdiplusflat.h(2309): error C2065: 'stream' : undeclared identifier1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gdiplusflat.h(2310): error C2275: 'HDC' : illegal use of this type as an expression1>          c:\program files (x86)\microsoft sdks\windows\v7.0a\include\windef.h(267) : see declaration of 'HDC'1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gdiplusflat.h(2310): error C2146: syntax error : missing ')' before identifier 'referenceHdc'1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gdiplusflat.h(2310): warning C4229: anachronism used : modifiers on data are ignored1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gdiplusflat.h(2310): error C2078: too many initializers1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gdiplusflat.h(2310): error C2275: 'HDC' : illegal use of this type as an expression1>          c:\program files (x86)\microsoft sdks\windows\v7.0a\include\windef.h(267) : see declaration of 'HDC'1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gdiplusflat.h(2316): error C2059: syntax error : ')'1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gdiplusflat.h(2320): error C2065: 'IStream' : undeclared identifier1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gdiplusflat.h(2320): error C2065: 'stream' : undeclared identifier1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gdiplusflat.h(2321): error C2275: 'HDC' : illegal use of this type as an expression1>          c:\program files (x86)\microsoft sdks\windows\v7.0a\include\windef.h(267) : see declaration of 'HDC'1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gdiplusflat.h(2321): error C2146: syntax error : missing ')' before identifier 'referenceHdc'1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gdiplusflat.h(2321): warning C4229: anachronism used : modifiers on data are ignored1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gdiplusflat.h(2321): error C2078: too many initializers1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gdiplusflat.h(2321): error C2275: 'HDC' : illegal use of this type as an expression1>          c:\program files (x86)\microsoft sdks\windows\v7.0a\include\windef.h(267) : see declaration of 'HDC'1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gdiplusflat.h(2327): error C2059: syntax error : ')'1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gdipluspath.h(133): error C2061: syntax error : identifier 'byte'1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gdiplusmetafile.h(75): error C2065: 'IStream' : undeclared identifier1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gdiplusmetafile.h(75): error C2065: 'stream' : undeclared identifier1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gdiplusmetafile.h(76): error C2448: 'Gdiplus::Metafile::{ctor}' : function-style initializer appears to be a function definition1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gdiplusmetafile.h(194): error C2065: 'IStream' : undeclared identifier1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gdiplusmetafile.h(194): error C2065: 'stream' : undeclared identifier1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gdiplusmetafile.h(195): error C2275: 'HDC' : illegal use of this type as an expression1>          c:\program files (x86)\microsoft sdks\windows\v7.0a\include\windef.h(267) : see declaration of 'HDC'1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gdiplusmetafile.h(195): error C2146: syntax error : missing ')' before identifier 'referenceHdc'1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gdiplusmetafile.h(195): error C2761: '{ctor}' : member function redeclaration not allowed1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gdiplusmetafile.h(198): error C2059: syntax error : ')'1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gdiplusmetafile.h(199): error C2143: syntax error : missing ';' before '{'1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gdiplusmetafile.h(199): error C2447: '{' : missing function header (old-style formal list?)1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gdiplusmetafile.h(211): error C2065: 'IStream' : undeclared identifier1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gdiplusmetafile.h(211): error C2065: 'stream' : undeclared identifier1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gdiplusmetafile.h(212): error C2275: 'HDC' : illegal use of this type as an expression1>          c:\program files (x86)\microsoft sdks\windows\v7.0a\include\windef.h(267) : see declaration of 'HDC'1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gdiplusmetafile.h(212): error C2146: syntax error : missing ')' before identifier 'referenceHdc'1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gdiplusmetafile.h(212): error C2761: '{ctor}' : member function redeclaration not allowed1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gdiplusmetafile.h(217): error C2059: syntax error : ')'1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gdiplusmetafile.h(218): error C2143: syntax error : missing ';' before '{'1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gdiplusmetafile.h(218): error C2447: '{' : missing function header (old-style formal list?)1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gdiplusmetafile.h(230): error C2065: 'IStream' : undeclared identifier1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gdiplusmetafile.h(230): error C2065: 'stream' : undeclared identifier1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gdiplusmetafile.h(231): error C2275: 'HDC' : illegal use of this type as an expression1>          c:\program files (x86)\microsoft sdks\windows\v7.0a\include\windef.h(267) : see declaration of 'HDC'1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gdiplusmetafile.h(231): error C2146: syntax error : missing ')' before identifier 'referenceHdc'1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gdiplusmetafile.h(231): error C2761: '{ctor}' : member function redeclaration not allowed1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gdiplusmetafile.h(236): error C2059: syntax error : ')'1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gdiplusmetafile.h(236): fatal error C1003: error count exceeds 100; stopping compilation

最佳答案

如果您在包含 <windows.h> 之前的某处有此行

#define WIN32_LEAN_AND_MEAN 

然后注释掉。

关于c++ - visual studio c++ 2010 express 使用 gdi 时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3489373/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com