GDI+ library causes “error C2760: syntax error: unexpected token 'identifier', expected 'type specifier'” in VS2017 when compiled for XP

前端 未结 3 1177
南旧
南旧 2021-01-22 01:48

I\'m trying to include the following definitions for GDI+ into my Win32 C++ project that is compiled under Visual Studio 2017:

#include 
#include         


        
3条回答
  •  囚心锁ツ
    2021-01-22 02:25

    There's a way to get this to work if you're prepared to edit the Windows header files.

    In objbase.h, comment out line 239 or change it to:

    static_assert (std::is_base_of ::value, "pp must derive from IUnknown");
    

    In gdiplusheaders.h, line 891, remove the redundant qualifier (Metafile::).

    In gdiplusstringformat.h, line 220, remove the redundant qualifier (StringFormat::).

    Hopefully, that will fix things for you without breaking anything.

提交回复
热议问题