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

前端 未结 3 1187
南旧
南旧 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:29

    Add this line before the very first(!) #include of COM-related header to fix objbase.h(239): error C2760: syntax error: unexpected token 'identifier', expected 'type specifier' :

    typedef struct IUnknown IUnknown;
    

    This fix works, because the line in objbase.h(239) mentioned in the error contains static_cast(*pp); despite that IUnknown still haven't been declared in that place.

提交回复
热议问题