error: 'wxGraphicsContext' was not declared in this scope

error: 'wxGraphicsContext' was not declared in this scope

#include <wx/graphics.h> 包含文件, Windows 7 上的 wxWidgets 3.0.2 使用 USE_GDIPLUS=1 标志编译。 但我仍然收到此错误

error: 'wxGraphicsContext' was not declared in this scope

这可能是什么原因造成的? 谢谢

wxWidgets 没有在任何地方使用 USE_GDIPLUS。如果您的意思是 wxUSE_GRAPHICS_GDIPLUS,那么它不是 make 选项而是 C++ 选项,即您需要编辑 wx/setup.h 以启用它。如果您使用 MinGW(而不是 MSVC),您还需要确保安装了必要的头文件和库,因为并非所有 MinGW 发行版都包含它们(但例如 TDM-GCC 包含)。