VC2008 で #include でコンパイルエラー

VC2008 で GDIPlus を使用しようとすると、以下のエラーが出る。

c:\program files\microsoft sdks\windows\v6.0a\include\gdiplusimaging.h(74) : error C4430: 型指定子がありません - int と仮定しました。メモ: C++ は int を既定値としてサポートしていません
c:\program files\microsoft sdks\windows\v6.0a\include\gdiplusimaging.h(74) : error C2440: '初期化中' : 'const char [37]' から 'int' に変換できません。
        この変換が可能なコンテキストはありません。
c:\program files\microsoft sdks\windows\v6.0a\include\gdiplusimaging.h(74) : error C2146: 構文エラー : ';' が、識別子 'IImageBytes' の前に必要です。
c:\program files\microsoft sdks\windows\v6.0a\include\gdiplusimaging.h(74) : error C2470: 'IImageBytes' : 関数定義のようですが、パラメータ リストがありません。外見上の本体をスキップします。
c:\program files\microsoft sdks\windows\v6.0a\include\gdiplusimaging.h(74) : error C2059: 構文エラー : 'public'
c:\program files\microsoft sdks\windows\v6.0a\include\gdiplusimaging.h(280) : error C2146: 構文エラー : ';' が、識別子 'id' の前に必要です。
c:\program files\microsoft sdks\windows\v6.0a\include\gdiplusimaging.h(280) : error C4430: 型指定子がありません - int と仮定しました。メモ: C++ は int を既定値としてサポートしていません
c:\program files\microsoft sdks\windows\v6.0a\include\gdiplusimaging.h(280) : error C4430: 型指定子がありません - int と仮定しました。メモ: C++ は int を既定値としてサポートしていません
c:\program files\microsoft sdks\windows\v6.0a\include\gdiplusheaders.h(384) : error C2061: 構文エラー : 識別子 'IStream'
c:\program files\microsoft sdks\windows\v6.0a\include\gdiplusheaders.h(395) : error C2061: 構文エラー : 識別子 'IStream'
c:\program files\microsoft sdks\windows\v6.0a\include\gdiplusheaders.h(405) : error C2061: 構文エラー : 識別子 'IStream'
c:\program files\microsoft sdks\windows\v6.0a\include\gdiplusheaders.h(443) : error C2061: 構文エラー : 識別子 'PROPID'
c:\program files\microsoft sdks\windows\v6.0a\include\gdiplusheaders.h(444) : error C2061: 構文エラー : 識別子 'PROPID'
c:\program files\microsoft sdks\windows\v6.0a\include\gdiplusheaders.h(445) : error C2061: 構文エラー : 識別子 'PROPID'
c:\program files\microsoft sdks\windows\v6.0a\include\gdiplusheaders.h(453) : error C2061: 構文エラー : 識別子 'PROPID'
c:\program files\microsoft sdks\windows\v6.0a\include\gdiplusheaders.h(471) : error C2535: 'Gdiplus::Image::Image(void)' : メンバ関数は、既に定義または宣言されています。
        c:\program files\microsoft sdks\windows\v6.0a\include\gdiplusheaders.h(384) : 'Gdiplus::Image::Image' の宣言を確認してください。
c:\program files\microsoft sdks\windows\v6.0a\include\gdiplusheaders.h(505) : error C2061: 構文エラー : 識別子 'IStream'
c:\program files\microsoft sdks\windows\v6.0a\include\gdiplusheaders.h(516) : error C2061: 構文エラー : 識別子 'IStream'
c:\program files\microsoft sdks\windows\v6.0a\include\gdiplusheaders.h(758) : error C2061: 構文エラー : 識別子 'IStream'
c:\program files\microsoft sdks\windows\v6.0a\include\gdiplusheaders.h(813) : error C2061: 構文エラー : 識別子 'IStream'
c:\program files\microsoft sdks\windows\v6.0a\include\gdiplusheaders.h(813) : error C2535: 'Gdiplus::Metafile::Metafile(void)' : メンバ関数は、既に定義または宣言されています。
        c:\program files\microsoft sdks\windows\v6.0a\include\gdiplusheaders.h(758) : 'Gdiplus::Metafile::Metafile' の宣言を確認してください。
c:\program files\microsoft sdks\windows\v6.0a\include\gdiplusheaders.h(820) : error C2061: 構文エラー : 識別子 'IStream'
c:\program files\microsoft sdks\windows\v6.0a\include\gdiplusheaders.h(820) : error C2535: 'Gdiplus::Metafile::Metafile(void)' : メンバ関数は、既に定義または宣言されています。
        c:\program files\microsoft sdks\windows\v6.0a\include\gdiplusheaders.h(758) : 'Gdiplus::Metafile::Metafile' の宣言を確認してください。
c:\program files\microsoft sdks\windows\v6.0a\include\gdiplusheaders.h(829) : error C2061: 構文エラー : 識別子 'IStream'
c:\program files\microsoft sdks\windows\v6.0a\include\gdiplusheaders.h(829) : error C2535: 'Gdiplus::Metafile::Metafile(void)' : メンバ関数は、既に定義または宣言されています。
        c:\program files\microsoft sdks\windows\v6.0a\include\gdiplusheaders.h(758) : 'Gdiplus::Metafile::Metafile' の宣言を確認してください。
c:\program files\microsoft sdks\windows\v6.0a\include\gdiplusheaders.h(855) : error C2061: 構文エラー : 識別子 'IStream'
c:\program files\microsoft sdks\windows\v6.0a\include\gdiplusheaders.h(923) : error C2535: 'Gdiplus::Metafile::Metafile(void)' : メンバ関数は、既に定義または宣言されています。
        c:\program files\microsoft sdks\windows\v6.0a\include\gdiplusheaders.h(758) : 'Gdiplus::Metafile::Metafile' の宣言を確認してください。
c:\program files\microsoft sdks\windows\v6.0a\include\gdiplusflat.h(1133) : error C2065: 'IStream' : 定義されていない識別子です。
c:\program files\microsoft sdks\windows\v6.0a\include\gdiplusflat.h(1133) : error C2065: 'stream' : 定義されていない識別子です。
c:\program files\microsoft sdks\windows\v6.0a\include\gdiplusflat.h(1133) : error C2065: 'image' : 定義されていない識別子です。
c:\program files\microsoft sdks\windows\v6.0a\include\gdiplusflat.h(1133) : error C2275: 'Gdiplus::GpImage' : この型は演算子として使用できません
        c:\program files\microsoft sdks\windows\v6.0a\include\gdiplusgpstubs.h(61) : 'Gdiplus::GpImage' の宣言を確認してください。
c:\program files\microsoft sdks\windows\v6.0a\include\gdiplusflat.h(1133) : warning C4229: 旧形式が使用されています : データの修飾子は無視されます。
c:\program files\microsoft sdks\windows\v6.0a\include\gdiplusflat.h(1133) : error C2078: 初期化子の数が多すぎます。
c:\program files\microsoft sdks\windows\v6.0a\include\gdiplusflat.h(1139) : error C2065: 'IStream' : 定義されていない識別子です。
c:\program files\microsoft sdks\windows\v6.0a\include\gdiplusflat.h(1139) : error C2065: 'stream' : 定義されていない識別子です。
c:\program files\microsoft sdks\windows\v6.0a\include\gdiplusflat.h(1139) : error C2065: 'image' : 定義されていない識別子です。
c:\program files\microsoft sdks\windows\v6.0a\include\gdiplusflat.h(1139) : error C2275: 'Gdiplus::GpImage' : この型は演算子として使用できません
        c:\program files\microsoft sdks\windows\v6.0a\include\gdiplusgpstubs.h(61) : 'Gdiplus::GpImage' の宣言を確認してください。
c:\program files\microsoft sdks\windows\v6.0a\include\gdiplusflat.h(1139) : warning C4229: 旧形式が使用されています : データの修飾子は無視されます。
c:\program files\microsoft sdks\windows\v6.0a\include\gdiplusflat.h(1139) : error C2078: 初期化子の数が多すぎます。
c:\program files\microsoft sdks\windows\v6.0a\include\gdiplusflat.h(1156) : error C2061: 構文エラー : 識別子 'IStream'
c:\program files\microsoft sdks\windows\v6.0a\include\gdiplusflat.h(1244) : error C2061: 構文エラー : 識別子 'PROPID'
c:\program files\microsoft sdks\windows\v6.0a\include\gdiplusflat.h(1247) : error C2061: 構文エラー : 識別子 'PROPID'
c:\program files\microsoft sdks\windows\v6.0a\include\gdiplusflat.h(1250) : error C2061: 構文エラー : 識別子 'PROPID'
c:\program files\microsoft sdks\windows\v6.0a\include\gdiplusflat.h(1262) : error C2061: 構文エラー : 識別子 'PROPID'
c:\program files\microsoft sdks\windows\v6.0a\include\gdiplusflat.h(1286) : error C2065: 'IStream' : 定義されていない識別子です。
c:\program files\microsoft sdks\windows\v6.0a\include\gdiplusflat.h(1286) : error C2065: 'stream' : 定義されていない識別子です。
c:\program files\microsoft sdks\windows\v6.0a\include\gdiplusflat.h(1286) : error C2065: 'bitmap' : 定義されていない識別子です。
c:\program files\microsoft sdks\windows\v6.0a\include\gdiplusflat.h(1286) : error C2275: 'Gdiplus::GpBitmap' : この型は演算子として使用できません
        c:\program files\microsoft sdks\windows\v6.0a\include\gdiplusgpstubs.h(62) : 'Gdiplus::GpBitmap' の宣言を確認してください。
c:\program files\microsoft sdks\windows\v6.0a\include\gdiplusflat.h(1286) : warning C4229: 旧形式が使用されています : データの修飾子は無視されます。
c:\program files\microsoft sdks\windows\v6.0a\include\gdiplusflat.h(1286) : error C2078: 初期化子の数が多すぎます。
c:\program files\microsoft sdks\windows\v6.0a\include\gdiplusflat.h(1292) : error C2065: 'IStream' : 定義されていない識別子です。
c:\program files\microsoft sdks\windows\v6.0a\include\gdiplusflat.h(1292) : error C2065: 'stream' : 定義されていない識別子です。
c:\program files\microsoft sdks\windows\v6.0a\include\gdiplusflat.h(1292) : error C2065: 'bitmap' : 定義されていない識別子です。
c:\program files\microsoft sdks\windows\v6.0a\include\gdiplusflat.h(1292) : error C2275: 'Gdiplus::GpBitmap' : この型は演算子として使用できません
        c:\program files\microsoft sdks\windows\v6.0a\include\gdiplusgpstubs.h(62) : 'Gdiplus::GpBitmap' の宣言を確認してください。
c:\program files\microsoft sdks\windows\v6.0a\include\gdiplusflat.h(1292) : warning C4229: 旧形式が使用されています : データの修飾子は無視されます。
c:\program files\microsoft sdks\windows\v6.0a\include\gdiplusflat.h(1292) : error C2078: 初期化子の数が多すぎます。
c:\program files\microsoft sdks\windows\v6.0a\include\gdiplusflat.h(2222) : error C2065: 'IStream' : 定義されていない識別子です。
c:\program files\microsoft sdks\windows\v6.0a\include\gdiplusflat.h(2222) : error C2065: 'stream' : 定義されていない識別子です。
c:\program files\microsoft sdks\windows\v6.0a\include\gdiplusflat.h(2224) : error C2065: 'header' : 定義されていない識別子です。
c:\program files\microsoft sdks\windows\v6.0a\include\gdiplusflat.h(2224) : error C2275: 'Gdiplus::MetafileHeader' : この型は演算子として使用できません
        c:\program files\microsoft sdks\windows\v6.0a\include\gdiplusmetaheader.h(112) : 'Gdiplus::MetafileHeader' の宣言を確認してください。
c:\program files\microsoft sdks\windows\v6.0a\include\gdiplusflat.h(2224) : warning C4229: 旧形式が使用されています : データの修飾子は無視されます。
c:\program files\microsoft sdks\windows\v6.0a\include\gdiplusflat.h(2224) : error C2078: 初期化子の数が多すぎます。
c:\program files\microsoft sdks\windows\v6.0a\include\gdiplusflat.h(2242) : error C2061: 構文エラー : 識別子 'IStream'
c:\program files\microsoft sdks\windows\v6.0a\include\gdiplusflat.h(2262) : error C2065: 'IStream' : 定義されていない識別子です。
c:\program files\microsoft sdks\windows\v6.0a\include\gdiplusflat.h(2262) : error C2065: 'stream' : 定義されていない識別子です。
c:\program files\microsoft sdks\windows\v6.0a\include\gdiplusflat.h(2262) : error C2065: 'metafile' : 定義されていない識別子です。
c:\program files\microsoft sdks\windows\v6.0a\include\gdiplusflat.h(2262) : error C2275: 'Gdiplus::GpMetafile' : この型は演算子として使用できません
        c:\program files\microsoft sdks\windows\v6.0a\include\gdiplusgpstubs.h(63) : 'Gdiplus::GpMetafile' の宣言を確認してください。
c:\program files\microsoft sdks\windows\v6.0a\include\gdiplusflat.h(2262) : warning C4229: 旧形式が使用されています : データの修飾子は無視されます。
c:\program files\microsoft sdks\windows\v6.0a\include\gdiplusflat.h(2262) : error C2078: 初期化子の数が多すぎます。
c:\program files\microsoft sdks\windows\v6.0a\include\gdiplusflat.h(2309) : error C2065: 'IStream' : 定義されていない識別子です。
c:\program files\microsoft sdks\windows\v6.0a\include\gdiplusflat.h(2309) : error C2065: 'stream' : 定義されていない識別子です。
c:\program files\microsoft sdks\windows\v6.0a\include\gdiplusflat.h(2310) : error C2275: 'HDC' : この型は演算子として使用できません
        c:\program files\microsoft sdks\windows\v6.0a\include\windef.h(267) : 'HDC' の宣言を確認してください。
c:\program files\microsoft sdks\windows\v6.0a\include\gdiplusflat.h(2310) : error C2146: 構文エラー : ')' が、識別子 'referenceHdc' の前に必要です。
c:\program files\microsoft sdks\windows\v6.0a\include\gdiplusflat.h(2310) : warning C4229: 旧形式が使用されています : データの修飾子は無視されます。
c:\program files\microsoft sdks\windows\v6.0a\include\gdiplusflat.h(2310) : error C2078: 初期化子の数が多すぎます。
c:\program files\microsoft sdks\windows\v6.0a\include\gdiplusflat.h(2310) : error C2275: 'HDC' : この型は演算子として使用できません
        c:\program files\microsoft sdks\windows\v6.0a\include\windef.h(267) : 'HDC' の宣言を確認してください。
c:\program files\microsoft sdks\windows\v6.0a\include\gdiplusflat.h(2316) : error C2059: 構文エラー : ')'
c:\program files\microsoft sdks\windows\v6.0a\include\gdiplusflat.h(2320) : error C2065: 'IStream' : 定義されていない識別子です。
c:\program files\microsoft sdks\windows\v6.0a\include\gdiplusflat.h(2320) : error C2065: 'stream' : 定義されていない識別子です。
c:\program files\microsoft sdks\windows\v6.0a\include\gdiplusflat.h(2321) : error C2275: 'HDC' : この型は演算子として使用できません
        c:\program files\microsoft sdks\windows\v6.0a\include\windef.h(267) : 'HDC' の宣言を確認してください。
c:\program files\microsoft sdks\windows\v6.0a\include\gdiplusflat.h(2321) : error C2146: 構文エラー : ')' が、識別子 'referenceHdc' の前に必要です。
c:\program files\microsoft sdks\windows\v6.0a\include\gdiplusflat.h(2321) : warning C4229: 旧形式が使用されています : データの修飾子は無視されます。
c:\program files\microsoft sdks\windows\v6.0a\include\gdiplusflat.h(2321) : error C2078: 初期化子の数が多すぎます。
c:\program files\microsoft sdks\windows\v6.0a\include\gdiplusflat.h(2321) : error C2275: 'HDC' : この型は演算子として使用できません
        c:\program files\microsoft sdks\windows\v6.0a\include\windef.h(267) : 'HDC' の宣言を確認してください。
c:\program files\microsoft sdks\windows\v6.0a\include\gdiplusflat.h(2327) : error C2059: 構文エラー : ')'
c:\program files\microsoft sdks\windows\v6.0a\include\gdipluspath.h(133) : error C2061: 構文エラー : 識別子 'byte'
c:\program files\microsoft sdks\windows\v6.0a\include\gdiplusmetafile.h(75) : error C2065: 'IStream' : 定義されていない識別子です。
c:\program files\microsoft sdks\windows\v6.0a\include\gdiplusmetafile.h(75) : error C2065: 'stream' : 定義されていない識別子です。
c:\program files\microsoft sdks\windows\v6.0a\include\gdiplusmetafile.h(76) : error C2448: 'Gdiplus::Metafile::{ctor}' : 関数の定義が間違っています。
c:\program files\microsoft sdks\windows\v6.0a\include\gdiplusmetafile.h(194) : error C2065: 'IStream' : 定義されていない識別子です。
c:\program files\microsoft sdks\windows\v6.0a\include\gdiplusmetafile.h(194) : error C2065: 'stream' : 定義されていない識別子です。
c:\program files\microsoft sdks\windows\v6.0a\include\gdiplusmetafile.h(195) : error C2275: 'HDC' : この型は演算子として使用できません
        c:\program files\microsoft sdks\windows\v6.0a\include\windef.h(267) : 'HDC' の宣言を確認してください。
c:\program files\microsoft sdks\windows\v6.0a\include\gdiplusmetafile.h(195) : error C2146: 構文エラー : ')' が、識別子 'referenceHdc' の前に必要です。
c:\program files\microsoft sdks\windows\v6.0a\include\gdiplusmetafile.h(195) : error C2761: '{ctor}' : メンバ関数の再宣言はできません。
c:\program files\microsoft sdks\windows\v6.0a\include\gdiplusmetafile.h(198) : error C2059: 構文エラー : ')'
c:\program files\microsoft sdks\windows\v6.0a\include\gdiplusmetafile.h(199) : error C2143: 構文エラー : ';' が '{' の前にありません。
c:\program files\microsoft sdks\windows\v6.0a\include\gdiplusmetafile.h(199) : error C2447: '{' : 対応する関数ヘッダーがありません (旧形式の仮引数リスト?)
c:\program files\microsoft sdks\windows\v6.0a\include\gdiplusmetafile.h(211) : error C2065: 'IStream' : 定義されていない識別子です。
c:\program files\microsoft sdks\windows\v6.0a\include\gdiplusmetafile.h(211) : error C2065: 'stream' : 定義されていない識別子です。
c:\program files\microsoft sdks\windows\v6.0a\include\gdiplusmetafile.h(212) : error C2275: 'HDC' : この型は演算子として使用できません
        c:\program files\microsoft sdks\windows\v6.0a\include\windef.h(267) : 'HDC' の宣言を確認してください。
c:\program files\microsoft sdks\windows\v6.0a\include\gdiplusmetafile.h(212) : error C2146: 構文エラー : ')' が、識別子 'referenceHdc' の前に必要です。
c:\program files\microsoft sdks\windows\v6.0a\include\gdiplusmetafile.h(212) : error C2761: '{ctor}' : メンバ関数の再宣言はできません。
c:\program files\microsoft sdks\windows\v6.0a\include\gdiplusmetafile.h(217) : error C2059: 構文エラー : ')'
c:\program files\microsoft sdks\windows\v6.0a\include\gdiplusmetafile.h(218) : error C2143: 構文エラー : ';' が '{' の前にありません。
c:\program files\microsoft sdks\windows\v6.0a\include\gdiplusmetafile.h(218) : error C2447: '{' : 対応する関数ヘッダーがありません (旧形式の仮引数リスト?)
c:\program files\microsoft sdks\windows\v6.0a\include\gdiplusmetafile.h(230) : error C2065: 'IStream' : 定義されていない識別子です。
c:\program files\microsoft sdks\windows\v6.0a\include\gdiplusmetafile.h(230) : error C2065: 'stream' : 定義されていない識別子です。
c:\program files\microsoft sdks\windows\v6.0a\include\gdiplusmetafile.h(231) : error C2275: 'HDC' : この型は演算子として使用できません
        c:\program files\microsoft sdks\windows\v6.0a\include\windef.h(267) : 'HDC' の宣言を確認してください。
c:\program files\microsoft sdks\windows\v6.0a\include\gdiplusmetafile.h(231) : error C2146: 構文エラー : ')' が、識別子 'referenceHdc' の前に必要です。
c:\program files\microsoft sdks\windows\v6.0a\include\gdiplusmetafile.h(231) : error C2761: '{ctor}' : メンバ関数の再宣言はできません。
c:\program files\microsoft sdks\windows\v6.0a\include\gdiplusmetafile.h(236) : error C2059: 構文エラー : ')'
c:\program files\microsoft sdks\windows\v6.0a\include\gdiplusmetafile.h(236) : fatal error C1003: プログラム内のエラーが 100 個を超えました。コンパイルは中断されます。

ググったら 2ch で解決した。

46 名前:デフォルトの名無しさん :2006/12/17(日) 10:44:47
    より先にをインクルードしろ。
    WIN32_LEAN_AND_MEAN抜きでをインクルードするのも良い。

47 名前:デフォルトの名無しさん :2006/12/17(日) 10:45:57
    すみません、自己解決しました。

    #include  を
    #include  の前に入れたら通りました。