When I set wxUSE_GRAPHICS_DIRECT2D to 1 wxWidgets compiles OK, but when linking C::B sdk the linker does not find the Direct2D functions. I am now on a different computer, don't have the exact error messages at hand.

I am using MSVC and i get GDI+ and Direct 2D out-of-the-box without any special setup. I remember in the past even GDI+ wasn't working on MinGW so this might indeed be a compiler issue. You can check setup.h, it should contain #ifdefs for these features to test the compiler version, might give you a hint which version is required.

Do you mean that I have to use MinGW-w64's gcc 8.1 and above? I have only gcc 7.2 at hand.

Logged

If some piece of memory should be reused, turn them to variables (or const variables).If some piece of operations should be reused, turn them to functions.If they happened together, then turn them to classes.

// Enable wxGraphicsContext and related classes for a modern 2D drawing API.//// Default is 1 except if you're using a compiler without support for GDI+// under MSW, i.e. gdiplus.h and related headers (MSVC and MinGW >= 4.8 are// known to have them). For other compilers (e.g. older mingw32) you may need// to install the headers (and just the headers) yourself. If you do, change// the setting below manually.//// Recommended setting: 1 if supported by the compilation environment

// Notice that we can't use wxCHECK_VISUALC_VERSION() nor wxCHECK_GCC_VERSION()// here as this file is included from wx/platform.h before they're defined.#if defined(_MSC_VER) || \ (defined(__MINGW32__) && (__GNUC__ > 4 || __GNUC_MINOR__ >= 8))#define wxUSE_GRAPHICS_CONTEXT 1#else// Disable support for other Windows compilers, enable it if your compiler// comes with new enough SDK or you installed the headers manually.//// Notice that this will be set by configure under non-Windows platforms// anyhow so the value there is not important.#define wxUSE_GRAPHICS_CONTEXT 0#endif

// The options here are only taken into account if wxUSE_GRAPHICS_CONTEXT is 1.

// Enable support for GDI+-based implementation of wxGraphicsContext.//// Default is 1.//// Recommended setting: 1 if you need to support XP, as Direct2D is not// available there.#define wxUSE_GRAPHICS_GDIPLUS wxUSE_GRAPHICS_CONTEXT

// Enable support for Direct2D-based implementation of wxGraphicsContext.//// Default is 1 for compilers which support it, i.e. VC10+ currently. If you// use an earlier MSVC version or another compiler and installed the necessary// SDK components manually, you need to change this setting.//// Recommended setting: 1 for faster and better quality graphics under Windows// 7 and later systems (if wxUSE_GRAPHICS_GDIPLUS is also enabled, earlier// systems will fall back on using GDI+).#if defined(_MSC_VER) && _MSC_VER >= 1600 #define wxUSE_GRAPHICS_DIRECT2D wxUSE_GRAPHICS_CONTEXT#else #define wxUSE_GRAPHICS_DIRECT2D 0#endif

||=== Build: scintilla in Code::Blocks wx3.1.x (64 bit) (compiler: GNU GCC Compiler) ===|C:\usr\Proj\cbBeta31\trunk\src\sdk\wxscintilla\src\PlatWX.cpp||In member function 'virtual void Font::Create(const FontParameters&)':|C:\usr\Proj\cbBeta31\trunk\src\sdk\wxscintilla\src\PlatWX.cpp|203|error: expected type-specifier before 'SurfaceFontDataD2D'|C:\usr\Proj\cbBeta31\trunk\src\sdk\wxscintilla\src\PlatWX.cpp|782|error: 'SurfaceFontDataD2D' does not name a type; did you mean 'SurfaceData'?|C:\usr\Proj\cbBeta31\trunk\src\sdk\wxscintilla\src\PlatWX.cpp|869|error: 'SurfaceFontDataD2D' has not been declared|C:\usr\Proj\cbBeta31\trunk\src\sdk\wxscintilla\src\PlatWX.cpp|869|error: non-member function 'bool Initialised()' cannot have cv-qualifier|C:\usr\Proj\cbBeta31\trunk\src\sdk\wxscintilla\src\PlatWX.cpp||In function 'bool Initialised()':|C:\usr\Proj\cbBeta31\trunk\src\sdk\wxscintilla\src\PlatWX.cpp|871|error: 'm_pTextFormat' was not declared in this scope|C:\usr\Proj\cbBeta31\trunk\src\sdk\wxscintilla\src\PlatWX.cpp|871|note: suggested alternative: 'GetTimeFormat'|C:\usr\Proj\cbBeta31\trunk\src\sdk\wxscintilla\src\PlatWX.cpp|877|error: 'SurfaceDataD2D' does not name a type; did you mean 'SurfaceData'?|C:\usr\Proj\cbBeta31\trunk\src\sdk\wxscintilla\src\PlatWX.cpp|911|error: 'SurfaceDataD2D' has not been declared|C:\usr\Proj\cbBeta31\trunk\src\sdk\wxscintilla\src\PlatWX.cpp|911|error: non-member function 'bool Initialised()' cannot have cv-qualifier|C:\usr\Proj\cbBeta31\trunk\src\sdk\wxscintilla\src\PlatWX.cpp|911|error: redefinition of 'bool Initialised()'|C:\usr\Proj\cbBeta31\trunk\src\sdk\wxscintilla\src\PlatWX.cpp|869|note: 'bool Initialised()' previously defined here|C:\usr\Proj\cbBeta31\trunk\src\sdk\wxscintilla\src\PlatWX.cpp||In function 'bool Initialised()':|C:\usr\Proj\cbBeta31\trunk\src\sdk\wxscintilla\src\PlatWX.cpp|913|error: 'm_pD2DFactory' was not declared in this scope|C:\usr\Proj\cbBeta31\trunk\src\sdk\wxscintilla\src\PlatWX.cpp|913|note: suggested alternative: 'wxDCFactory'|C:\usr\Proj\cbBeta31\trunk\src\sdk\wxscintilla\src\PlatWX.cpp|913|error: 'm_pDWriteFactory' was not declared in this scope|C:\usr\Proj\cbBeta31\trunk\src\sdk\wxscintilla\src\PlatWX.cpp|913|note: suggested alternative: 'IID_ITypeFactory'|C:\usr\Proj\cbBeta31\trunk\src\sdk\wxscintilla\src\PlatWX.cpp|916|error: 'SurfaceDataD2D' has not been declared|C:\usr\Proj\cbBeta31\trunk\src\sdk\wxscintilla\src\PlatWX.cpp||In function 'void DiscardGraphicsResources()':|C:\usr\Proj\cbBeta31\trunk\src\sdk\wxscintilla\src\PlatWX.cpp|918|error: 'm_pRenderTarget' was not declared in this scope|C:\usr\Proj\cbBeta31\trunk\src\sdk\wxscintilla\src\PlatWX.cpp|919|error: 'm_pSolidBrush' was not declared in this scope|C:\usr\Proj\cbBeta31\trunk\src\sdk\wxscintilla\src\PlatWX.cpp|919|note: suggested alternative: 'CreateSolidBrush'|C:\usr\Proj\cbBeta31\trunk\src\sdk\wxscintilla\src\PlatWX.cpp|920|error: 'm_pPatternBrush' was not declared in this scope|C:\usr\Proj\cbBeta31\trunk\src\sdk\wxscintilla\src\PlatWX.cpp|920|note: suggested alternative: 'CreatePatternBrush'|C:\usr\Proj\cbBeta31\trunk\src\sdk\wxscintilla\src\PlatWX.cpp|923|error: 'SurfaceDataD2D' has not been declared|C:\usr\Proj\cbBeta31\trunk\src\sdk\wxscintilla\src\PlatWX.cpp||In function 'HRESULT CreateGraphicsResources()':|C:\usr\Proj\cbBeta31\trunk\src\sdk\wxscintilla\src\PlatWX.cpp|926|error: 'm_pRenderTarget' was not declared in this scope|C:\usr\Proj\cbBeta31\trunk\src\sdk\wxscintilla\src\PlatWX.cpp|928|error: 'D2D1_RENDER_TARGET_PROPERTIES' was not declared in this scope|C:\usr\Proj\cbBeta31\trunk\src\sdk\wxscintilla\src\PlatWX.cpp|934|error: 'm_pD2DFactory' was not declared in this scope|C:\usr\Proj\cbBeta31\trunk\src\sdk\wxscintilla\src\PlatWX.cpp|934|note: suggested alternative: 'wxDCFactory'|C:\usr\Proj\cbBeta31\trunk\src\sdk\wxscintilla\src\PlatWX.cpp|935|error: 'renderTargetProperties' was not declared in this scope|C:\usr\Proj\cbBeta31\trunk\src\sdk\wxscintilla\src\PlatWX.cpp|935|note: suggested alternative: 'PrinterProperties'|C:\usr\Proj\cbBeta31\trunk\src\sdk\wxscintilla\src\PlatWX.cpp|940|error: 'D2D1_COLOR_F' does not name a type; did you mean 'DM_COLOR'?|C:\usr\Proj\cbBeta31\trunk\src\sdk\wxscintilla\src\PlatWX.cpp|941|error: 'color' was not declared in this scope|C:\usr\Proj\cbBeta31\trunk\src\sdk\wxscintilla\src\PlatWX.cpp|941|error: 'm_pSolidBrush' was not declared in this scope|C:\usr\Proj\cbBeta31\trunk\src\sdk\wxscintilla\src\PlatWX.cpp|941|note: suggested alternative: 'CreateSolidBrush'|C:\usr\Proj\cbBeta31\trunk\src\sdk\wxscintilla\src\PlatWX.cpp|946|error: 'D2D1_BITMAP_BRUSH_PROPERTIES' was not declared in this scope|C:\usr\Proj\cbBeta31\trunk\src\sdk\wxscintilla\src\PlatWX.cpp|951|error: 'wxCOMPtr' was not declared in this scope|C:\usr\Proj\cbBeta31\trunk\src\sdk\wxscintilla\src\PlatWX.cpp|951|note: suggested alternative: 'wxCOPY'|C:\usr\Proj\cbBeta31\trunk\src\sdk\wxscintilla\src\PlatWX.cpp|951|error: 'ID2D1Bitmap' was not declared in this scope|C:\usr\Proj\cbBeta31\trunk\src\sdk\wxscintilla\src\PlatWX.cpp|951|note: suggested alternative: 'LoadBitmap'|C:\usr\Proj\cbBeta31\trunk\src\sdk\wxscintilla\src\PlatWX.cpp|951|error: 'bitmap' was not declared in this scope|C:\usr\Proj\cbBeta31\trunk\src\sdk\wxscintilla\src\PlatWX.cpp|951|note: suggested alternative: 'wxBitmap'|C:\usr\Proj\cbBeta31\trunk\src\sdk\wxscintilla\src\PlatWX.cpp|953|error: 'D2D1_PIXEL_FORMAT' was not declared in this scope|C:\usr\Proj\cbBeta31\trunk\src\sdk\wxscintilla\src\PlatWX.cpp|953|note: suggested alternative: 'EMR_PIXELFORMAT'|C:\usr\Proj\cbBeta31\trunk\src\sdk\wxscintilla\src\PlatWX.cpp|958|error: 'D2D1' has not been declared|C:\usr\Proj\cbBeta31\trunk\src\sdk\wxscintilla\src\PlatWX.cpp|959|error: 'D2D1' has not been declared|C:\usr\Proj\cbBeta31\trunk\src\sdk\wxscintilla\src\PlatWX.cpp|959|error: 'pixel_format' was not declared in this scope|C:\usr\Proj\cbBeta31\trunk\src\sdk\wxscintilla\src\PlatWX.cpp|959|note: suggested alternative: 'wxPixelFormat'|C:\usr\Proj\cbBeta31\trunk\src\sdk\wxscintilla\src\PlatWX.cpp|962|error: 'brushProperties' was not declared in this scope|C:\usr\Proj\cbBeta31\trunk\src\sdk\wxscintilla\src\PlatWX.cpp|962|note: suggested alternative: 'EdgeProperties'|C:\usr\Proj\cbBeta31\trunk\src\sdk\wxscintilla\src\PlatWX.cpp|963|error: 'm_pPatternBrush' was not declared in this scope|C:\usr\Proj\cbBeta31\trunk\src\sdk\wxscintilla\src\PlatWX.cpp|963|note: suggested alternative: 'CreatePatternBrush'|C:\usr\Proj\cbBeta31\trunk\src\sdk\wxscintilla\src\PlatWX.cpp|969|error: 'SurfaceDataD2D' has not been declared|C:\usr\Proj\cbBeta31\trunk\src\sdk\wxscintilla\src\PlatWX.cpp||In function 'void SetEditorPaintAbandoned()':|C:\usr\Proj\cbBeta31\trunk\src\sdk\wxscintilla\src\PlatWX.cpp|971|error: 'm_editor' was not declared in this scope|C:\usr\Proj\cbBeta31\trunk\src\sdk\wxscintilla\src\PlatWX.cpp|971|note: suggested alternative: 'Editor'|C:\usr\Proj\cbBeta31\trunk\src\sdk\wxscintilla\src\PlatWX.cpp|1066|error: 'wxCOMPtr' does not name a type; did you mean 'wxCOPY'?|C:\usr\Proj\cbBeta31\trunk\src\sdk\wxscintilla\src\PlatWX.cpp|1067|error: 'wxCOMPtr' does not name a type; did you mean 'wxCOPY'?|C:\usr\Proj\cbBeta31\trunk\src\sdk\wxscintilla\src\PlatWX.cpp|1068|error: 'wxCOMPtr' does not name a type; did you mean 'wxCOPY'?|C:\usr\Proj\cbBeta31\trunk\src\sdk\wxscintilla\src\PlatWX.cpp|1069|error: 'wxCOMPtr' does not name a type; did you mean 'wxCOPY'?|C:\usr\Proj\cbBeta31\trunk\src\sdk\wxscintilla\src\PlatWX.cpp|1070|error: 'wxCOMPtr' does not name a type; did you mean 'wxCOPY'?|C:\usr\Proj\cbBeta31\trunk\src\sdk\wxscintilla\src\PlatWX.cpp|1072|error: 'SurfaceDataD2D' does not name a type; did you mean 'SurfaceData'?|C:\usr\Proj\cbBeta31\trunk\src\sdk\wxscintilla\src\PlatWX.cpp||In constructor 'SurfaceD2D::SurfaceD2D()':|C:\usr\Proj\cbBeta31\trunk\src\sdk\wxscintilla\src\PlatWX.cpp|1077|error: class 'SurfaceD2D' does not have any field named 'm_pDWriteFactory'|C:\usr\Proj\cbBeta31\trunk\src\sdk\wxscintilla\src\PlatWX.cpp|1077|error: '::wxDWriteFactory' has not been declared|C:\usr\Proj\cbBeta31\trunk\src\sdk\wxscintilla\src\PlatWX.cpp|1077|note: suggested alternative: 'wxDCFactory'|C:\usr\Proj\cbBeta31\trunk\src\sdk\wxscintilla\src\PlatWX.cpp|1092|error: 'm_surfaceData' was not declared in this scope|C:\usr\Proj\cbBeta31\trunk\src\sdk\wxscintilla\src\PlatWX.cpp|1092|note: suggested alternative: 'SurfaceData'|C:\usr\Proj\cbBeta31\trunk\src\sdk\wxscintilla\src\PlatWX.cpp||In member function 'virtual void SurfaceD2D::Init(SurfaceID, WindowID)':|C:\usr\Proj\cbBeta31\trunk\src\sdk\wxscintilla\src\PlatWX.cpp|1125|error: 'm_surfaceData' was not declared in this scope|C:\usr\Proj\cbBeta31\trunk\src\sdk\wxscintilla\src\PlatWX.cpp|1125|note: suggested alternative: 'SurfaceData'|C:\usr\Proj\cbBeta31\trunk\src\sdk\wxscintilla\src\PlatWX.cpp|1125|error: 'SurfaceDataD2D' does not name a type; did you mean 'SurfaceData'?|C:\usr\Proj\cbBeta31\trunk\src\sdk\wxscintilla\src\PlatWX.cpp|1125|error: expected '>' before '*' token|C:\usr\Proj\cbBeta31\trunk\src\sdk\wxscintilla\src\PlatWX.cpp|1125|error: expected '(' before '*' token|C:\usr\Proj\cbBeta31\trunk\src\sdk\wxscintilla\src\PlatWX.cpp|1125|error: expected primary-expression before '>' token|C:\usr\Proj\cbBeta31\trunk\src\sdk\wxscintilla\src\PlatWX.cpp|1125|error: expected ')' before ';' token|||More errors follow but not being shown.|||Edit the max errors limit in compiler options...|||=== Build failed: 50 error(s), 0 warning(s) (0 minute(s), 13 second(s)) ===|