After updating to r11701 I can't compile C::B due to this lines in PlatWX.cpp
#if wxCHECK_VERSION(3, 1, 0) && defined(__WXMSW__) && !defined(HAVE_DIRECTWRITE_TECHNOLOGY)
#error "You need to have Direct2D capable wxWidget build to build Code::Blocks. We want to support fonts with ligatures!!!"
#endif // wxCHECK_VERSION(3, 1, 0) && defined(__WXMSW__) && !defined(HAVE_DIRECTWRITE_TECHNOLOGY)
I have changed wxUSE_GRAPHICS_GDIPLUS to 0 and wxUSE_GRAPHICS_DIRECT2D to 1 in my setup.h and recompiled wx3.1.2, but now I get linking errors when creating libwxscintilla.a:
undefined reference to wxGCDC::AcquireHDC()
undefined reference to wxGraphicsRenderer::GetDefaultRenderer()
and more like those. Which configuration should I use to get this to work?.
Ok, updating to mingw-w64 with GCC 8.1 did the trick.
I am using MSVC and i get GDI+ and Direct 2D out-of-the-box without any special setup
MSVC has Direct2D activated by default, when using GCC you must activate it explicitly. This is the original setup.h code:
#if defined(_MSC_VER) && _MSC_VER >= 1600
#define wxUSE_GRAPHICS_DIRECT2D wxUSE_GRAPHICS_CONTEXT
#else
#define wxUSE_GRAPHICS_DIRECT2D 0
#endif
I don't use any MS product (apart from Windows, of course).
Do you mean that I have to use MinGW-w64's gcc 8.1 and above?
I have only gcc 7.2 at hand.
You have to use a compiler which has the direct2d headers/libs or you have to manually comment the enforcing code in local builds.
I'm using mingw810_64seh> gcc.exe --version
gcc.exe (x86_64-posix-seh-rev0, Built by MinGW-W64 project) 8.1.0
Could you please tell us what we have to do to get around this problem.
I don't understand the comment above. What does "comment the enforcing code" mean? And where would that be?
The setup.h for wxWidgets 3.1.1 here is:
// 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
...further down....
/* --- end common options --- */
/* --- start MSW options --- */
// ----------------------------------------------------------------------------
// Graphics backends choices for Windows
// ----------------------------------------------------------------------------
// 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
But I still get the problem.
#define wxUSE_GRAPHICS_DIRECT2D 0
The above likely needs to
#define wxUSE_GRAPHICS_DIRECT2D 1
Tim S.
The error is caused by the line 34 in PlatWX.cpp
#if defined(__WXMSW__) && wxUSE_GRAPHICS_DIRECT2D
adding "defined()" around wxUSE_GRAPHICS_DIRECT2D solves this problem and gets me further.
eg.
#if defined(__WXMSW__) && defined(wxUSE_GRAPHICS_DIRECT2D)
Now I'm getting pummeled with errors from PlatWx that I don't understand:
||=== 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)) ===|
Nope, you broke it more :). wxUSE_GRAPHICS_DIRECT2D is ALWAYS defined, but it has the value 0 if its off and 1 if its on. Your check always returns true but its value seems be 0, your error messages indicate that it doesn't find Direct2D related headers.
The problem is that setup.h does enable wxUSE_GRAPHICS_CONTEXT but not wxUSE_GRAPHICS_DIRECT2D
// 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
Easiest fix is to set it 1 in the #else case as well.
Thanks sodev
I reverted my local CB (removing all my dumb changes) and changed setup.h to specify
"#define wxUSE_GRAPHICS_DIRECT2D 1"
That solved the compile problem. But now I get Link errors.
g++.exe -shared -Wl,--out-implib=devel31_64\libcodeblocks.a -Wl,--dll -Lbase\tinyxml -LC:\usr\Proj\wxWidgets3110\lib\gcc_dll -Ldevel31_64 -Lsdk\scripting\lib .objs31_64\sdk\configmanager-revision.o .objs31_64\sdk\annoyingdialog.o .objs31_64\sdk\autodetectcompilers.o .objs31_64\sdk\base64.o .objs31_64\sdk\blockallocated.o .objs31_64\sdk\cbauibook.o .objs31_64\sdk\cbcolourmanager.o .objs31_64\sdk\cbdebugger_interfaces.o .objs31_64\sdk\cbeditor.o .objs31_64\sdk\cbeditorprintout.o .objs31_64\sdk\cbexception.o .objs31_64\sdk\cbplugin.o .objs31_64\sdk\cbproject.o .objs31_64\sdk\cbstatusbar.o .objs31_64\sdk\cbstyledtextctrl.o .objs31_64\sdk\cbthreadpool.o .objs31_64\sdk\cbtreectrl.o .objs31_64\sdk\cbworkspace.o .objs31_64\sdk\ccmanager.o .objs31_64\sdk\compileoptionsbase.o .objs31_64\sdk\compiler.o .objs31_64\sdk\compilercommandgenerator.o .objs31_64\sdk\compilerfactory.o .objs31_64\sdk\compileroptions.o .objs31_64\sdk\compiletargetbase.o .objs31_64\sdk\configmanager.o .objs31_64\sdk\configurationpanel.o .objs31_64\sdk\configuretoolsdlg.o .objs31_64\sdk\confirmreplacedlg.o .objs31_64\sdk\crc32.o .objs31_64\sdk\debuggermanager.o .objs31_64\sdk\editarrayfiledlg.o .objs31_64\sdk\editarrayorderdlg.o .objs31_64\sdk\editarraystringdlg.o .objs31_64\sdk\editor_hooks.o .objs31_64\sdk\editorbase.o .objs31_64\sdk\editorcolourset.o .objs31_64\sdk\editorlexerloader.o .objs31_64\sdk\editormanager.o .objs31_64\sdk\editpairdlg.o .objs31_64\sdk\editpathdlg.o .objs31_64\sdk\edittooldlg.o .objs31_64\sdk\encodingdetector.o .objs31_64\sdk\externaldepsdlg.o .objs31_64\sdk\filefilters.o .objs31_64\sdk\filegroupsandmasks.o .objs31_64\sdk\filemanager.o .objs31_64\sdk\findreplacedlg.o .objs31_64\sdk\genericmultilinenotesdlg.o .objs31_64\sdk\globals.o .objs31_64\sdk\importers_globals.o .objs31_64\sdk\incremental_select_helper.o .objs31_64\sdk\infowindow.o .objs31_64\sdk\loggers.o .objs31_64\sdk\logmanager.o .objs31_64\sdk\macrosmanager.o .objs31_64\sdk\manager.o .objs31_64\sdk\menuitemsmanager.o .objs31_64\sdk\mozilla_chardet\src\CharDistribution.o .objs31_64\sdk\mozilla_chardet\src\JpCntx.o .objs31_64\sdk\mozilla_chardet\src\LangBulgarianModel.o .objs31_64\sdk\mozilla_chardet\src\LangCyrillicModel.o .objs31_64\sdk\mozilla_chardet\src\LangGreekModel.o .objs31_64\sdk\mozilla_chardet\src\LangHebrewModel.o .objs31_64\sdk\mozilla_chardet\src\LangHungarianModel.o .objs31_64\sdk\mozilla_chardet\src\LangThaiModel.o .objs31_64\sdk\mozilla_chardet\src\nsBig5Prober.o .objs31_64\sdk\mozilla_chardet\src\nsCharSetProber.o .objs31_64\sdk\mozilla_chardet\src\nsEscCharsetProber.o .objs31_64\sdk\mozilla_chardet\src\nsEscSM.o .objs31_64\sdk\mozilla_chardet\src\nsEUCJPProber.o .objs31_64\sdk\mozilla_chardet\src\nsEUCKRProber.o .objs31_64\sdk\mozilla_chardet\src\nsEUCTWProber.o .objs31_64\sdk\mozilla_chardet\src\nsGB2312Prober.o .objs31_64\sdk\mozilla_chardet\src\nsHebrewProber.o .objs31_64\sdk\mozilla_chardet\src\nsLatin1Prober.o .objs31_64\sdk\mozilla_chardet\src\nsMBCSGroupProber.o .objs31_64\sdk\mozilla_chardet\src\nsMBCSSM.o .objs31_64\sdk\mozilla_chardet\src\nsSBCharSetProber.o .objs31_64\sdk\mozilla_chardet\src\nsSBCSGroupProber.o .objs31_64\sdk\mozilla_chardet\src\nsSJISProber.o .objs31_64\sdk\mozilla_chardet\src\nsUniversalDetector.o .objs31_64\sdk\mozilla_chardet\src\nsUTF8Prober.o .objs31_64\sdk\multiselectdlg.o .objs31_64\sdk\newfromtemplatedlg.o .objs31_64\sdk\personalitymanager.o .objs31_64\sdk\pipedprocess.o .objs31_64\sdk\pluginmanager.o .objs31_64\sdk\pluginsconfigurationdlg.o .objs31_64\sdk\printing_types.o .objs31_64\sdk\projectbuildtarget.o .objs31_64\sdk\projectfile.o .objs31_64\sdk\projectfileoptionsdlg.o .objs31_64\sdk\projectlayoutloader.o .objs31_64\sdk\projectloader.o .objs31_64\sdk\projectloader_hooks.o .objs31_64\sdk\projectmanager.o .objs31_64\sdk\projectsfilemasksdlg.o .objs31_64\sdk\projecttemplateloader.o .objs31_64\sdk\scripting\bindings\sc_consts.o .objs31_64\sdk\scripting\bindings\sc_dialog.o .objs31_64\sdk\scripting\bindings\sc_globals.o .objs31_64\sdk\scripting\bindings\sc_io.o .objs31_64\sdk\scripting\bindings\sc_plugin.o .objs31_64\sdk\scripting\bindings\sc_progress.o .objs31_64\sdk\scripting\bindings\sc_util_dialogs.o .objs31_64\sdk\scripting\bindings\sc_wxtypes.o .objs31_64\sdk\scripting\bindings\scriptbindings.o .objs31_64\sdk\scriptingmanager.o .objs31_64\sdk\scriptsecuritywarningdlg.o .objs31_64\sdk\scrollingdialog.o .objs31_64\sdk\sdk_events.o .objs31_64\sdk\searchresultslog.o .objs31_64\sdk\selecttargetdlg.o .objs31_64\sdk\templatemanager.o .objs31_64\sdk\tinywxuni.o .objs31_64\sdk\toolsmanager.o .objs31_64\sdk\uservarmanager.o .objs31_64\sdk\workspaceloader.o .objs31_64\sdk\xtra_res.o -o devel31_64\codeblocks.dll -Wl,--enable-auto-image-base -Wl,--export-all-symbols -Wl,--add-stdcall-alias -Wl,--enable-auto-import -Wl,--no-undefined -lshfolder -ltxml31_64 -lwxscintilla_cb -lsqplus31_64 -lsqstdlib31_64 -lsquirrel31_64 -lgdi32 -lwxmsw31u
devel31_64/libwxscintilla_cb.a(PlatWX.o): In function `SurfaceFontDataD2D::SurfaceFontDataD2D(FontParameters const&)':
C:/usr/Proj/cbBeta31/trunk/src/sdk/wxscintilla/src/PlatWX.cpp:784: undefined reference to `__imp__Z15wxDWriteFactoryv'
devel31_64/libwxscintilla_cb.a(PlatWX.o): In function `SurfaceDataD2D::SurfaceDataD2D(ScintillaWX*)':
C:/usr/Proj/cbBeta31/trunk/src/sdk/wxscintilla/src/PlatWX.cpp:880: undefined reference to `__imp__Z13wxD2D1Factoryv'
C:/usr/Proj/cbBeta31/trunk/src/sdk/wxscintilla/src/PlatWX.cpp:880: undefined reference to `__imp__Z15wxDWriteFactoryv'
devel31_64/libwxscintilla_cb.a(PlatWX.o): In function `SurfaceD2D::SurfaceD2D()':
C:/usr/Proj/cbBeta31/trunk/src/sdk/wxscintilla/src/PlatWX.cpp:1077: undefined reference to `__imp__Z15wxDWriteFactoryv'
collect2.exe: error: ld returned 1 exit status
Process terminated with status 1 (2 minute(s), 37 second(s))
5 error(s), 22 warning(s) (2 minute(s), 37 second(s))
Is this an indication I need to re-compile wxWidgets 3.1.1 ? If so, what compile settings should I use?
Current my compile settings are (using gcc.exe (x86_64-posix-seh-rev0, Built by MinGW-W64 project) 8.1.0):
mingw32-make -f makefile.gcc USE_XRC=1 SHARED=1 MONOLITHIC=1 BUILD=release UNICODE=1 USE_OPENGL=1 VENDOR=cb CXXFLAGS="-std=gnu++11 -fno-keep-inline-dllexport -fpermissive -Wno-unused-local-typedefs -Wno-ignored-qualifiers -Wno-cast-function-type"
I am using wx3.1.2 in 32 bits and it works OK, but you will get crashes with Code Completion if you don't backport New Pagodi's changes to wxPopupWindow in wx trunk to wx3.1.2
I published a patch with this backport (and the final files for easier use) in the forum, see http://forums.codeblocks.org/index.php/topic,22974.msg156992.html#msg156992 (http://forums.codeblocks.org/index.php/topic,22974.msg156992.html#msg156992)
Regarding the wxWidgets configuration for Direct2D, if lib/gcc_dll/mswu/wx/setup.h exists then it is used for the compilation; if not, then include/wx/msw/setup.h is copied there when compilation starts. Cleaning the target does not delete the setup.h under lib, so any changes made to include/wx/msw/setup.h are ignored. EDIT: the safest way is deletion of lib/gcc_dll (or the 64 variant), edition of include/wx/msw/setup.h and making from scratch.
The only change required to setup.h is from
#if defined(_MSC_VER) && _MSC_VER >= 1600
#define wxUSE_GRAPHICS_DIRECT2D wxUSE_GRAPHICS_CONTEXT
#else
#define wxUSE_GRAPHICS_DIRECT2D 0
#endif
to
#if defined(_MSC_VER) && _MSC_VER >= 1600
#define wxUSE_GRAPHICS_DIRECT2D wxUSE_GRAPHICS_CONTEXT
#else
#define wxUSE_GRAPHICS_DIRECT2D wxUSE_GRAPHICS_CONTEXT
#endif
or
#define wxUSE_GRAPHICS_DIRECT2D wxUSE_GRAPHICS_CONTEXT
In about 2 weeks, I hope to have a patch to submit to the wxWidgets master branch to fix this issue for mingw64 gcc builds. I am testing my change to see if it works; then, I need to re-read the setup.h patch documentation to see how to do it.
My patch to fix only configure/make builds. Still needs tested. Patch failed testing!
--- a/setup.h.in
+++ b/setup.h.in
@@ -671,7 +671,7 @@
#define wxUSE_GRAPHICS_GDIPLUS wxUSE_GRAPHICS_CONTEXT
-#if defined(_MSC_VER) && _MSC_VER >= 1600
+#if defined(_MSC_VER) && _MSC_VER >= 1600 || defined(__MINGW64_TOOLCHAIN__)
#define wxUSE_GRAPHICS_DIRECT2D wxUSE_GRAPHICS_CONTEXT
#else
#define wxUSE_GRAPHICS_DIRECT2D 0
Tim S.