Project

General

Profile

Actions

Bug #7505

closed

4.3.0 Windows Compile Error: WRasterImage-d2d1.C

Added by Stefan Bn about 4 years ago. Updated almost 4 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
-
Start date:
03/26/2020
Due date:
% Done:

0%

Estimated time:

Description

There is a compilation error when building on Windows using WT_WRASTERIMAGE_IMPLEMENTATION = Direct2D:

[ 87%] Building CXX object src/CMakeFiles/wt.dir/Wt/WRasterImage-d2d1.C.obj D:\Dev\BuildLibs\wt\wt-4.3.0\src\Wt\WRasterImage-d2d1.C: In member function 'vir
tual void Wt::WRasterImage::drawText(const Wt::WRectF&, Wt::WFlags<Wt::AlignmentFlag>, Wt::TextFlag, const Wt::WString&, const Wt::WPointF*)':
D:\Dev\BuildLibs\wt\wt-4.3.0\src\Wt\WRasterImage-d2d1.C:965:11: error: 'class Wt::FontSupport::FontMatch' has no member named 'textFormat'  
  965 |     match.textFormat()->SetParagraphAlignment(DWRITE_PARAGRAPH_ALIGNMENT_NEAR);
      |           ^~~~~~~~~~
D:\Dev\BuildLibs\wt\wt-4.3.0\src\Wt\WRasterImage-d2d1.C:968:11: error: 'class Wt::FontSupport::FontMatch' has no member named 'textFormat'
  968 |     match.textFormat()->SetParagraphAlignment(DWRITE_PARAGRAPH_ALIGNMENT
_CENTER);
      |           ^~~~~~~~~~
D:\Dev\BuildLibs\wt\wt-4.3.0\src\Wt\WRasterImage-d2d1.C:971:11: error: 'class Wt::FontSupport::FontMatch' has no member named 'textFormat'
  971 |     match.textFormat()->SetParagraphAlignment(DWRITE_PARAGRAPH_ALIGNMENT
_FAR);
      |           ^~~~~~~~~~
D:\Dev\BuildLibs\wt\wt-4.3.0\src\Wt\WRasterImage-d2d1.C:978:11: error: 'class Wt::FontSupport::FontMatch' has no member named 'textFormat'
  978 |     match.textFormat()->SetTextAlignment(DWRITE_TEXT_ALIGNMENT_LEADING);
      |           ^~~~~~~~~~
D:\Dev\BuildLibs\wt\wt-4.3.0\src\Wt\WRasterImage-d2d1.C:981:11: error: 'class Wt::FontSupport::FontMatch' has no member named 'textFormat'
  981 |     match.textFormat()->SetTextAlignment(DWRITE_TEXT_ALIGNMENT_CENTER);
      |           ^~~~~~~~~~
D:\Dev\BuildLibs\wt\wt-4.3.0\src\Wt\WRasterImage-d2d1.C:984:11: error: 'class Wt::FontSupport::FontMatch' has no member named 'textFormat'
  984 |     match.textFormat()->SetTextAlignment(DWRITE_TEXT_ALIGNMENT_TRAILING)
;
      |           ^~~~~~~~~~
D:\Dev\BuildLibs\wt\wt-4.3.0\src\Wt\WRasterImage-d2d1.C:988:55: error: 'class Wt::FontSupport' has no member named 'writeFactory'
  988 |   IDWriteFactory *writeFactory = impl_->fontSupport_->writeFactory();
      |                                                       ^~~~~~~~~~~~
D:\Dev\BuildLibs\wt\wt-4.3.0\src\Wt\WRasterImage-d2d1.C:993:11: error: 'class Wt::FontSupport::FontMatch' has no member named 'textFormat'
  993 |     match.textFormat(),
      |           ^~~~~~~~~~
mingw32-make[2]: *** [src\CMakeFiles\wt.dir\build.make:4885: src/CMakeFiles/wt.dir/Wt/WRasterImage-d2d1.C.obj] Error 1
mingw32-make[1]: *** [CMakeFiles\Makefile2:512: src/CMakeFiles/wt.dir/all] Error 2
mingw32-make: *** [Makefile:129: all] Error 2

I didn't use WRasterImage so far, so I didn't notice yet ... but now I'd like to use it :-)

Actions #1

Updated by Roel Standaert about 4 years ago

That's surprising, we always do our Windows builds with Direct2D. But you're using MinGW, maybe?

Actions #2

Updated by Stefan Bn about 4 years ago

Yes, MinGW it is!

Actions #3

Updated by Stefan Bn about 4 years ago

Its MinGW 9.2 on Windows 10. I applied a quick hack to ./src/CMakeLists.txt:

#IF(HAVE_HARU OR "${WT_WRASTERIMAGE_IMPLEMENTATION}" STREQUAL "GraphicsMagick" OR "${WT_WRASTERIMAGE_IMPLEMENTATION}" STREQUAL "Direct2D")
#  IF(HAVE_PANGO AND NOT "${WT_WRASTERIMAGE_IMPLEMENTATION}" STREQUAL "Direct2D")
#    SET(libsources ${libsources} Wt/FontSupport.h Wt/FontSupportPango.C)
#    SET(WT_FONTSUPPORT_PANGO true)
#  ELSEIF(HAVE_DIRECTWRITE)
#    SET(libsources ${libsources} Wt/FontSupport.h Wt/FontSupportDirectWrite.C)
#    SET(WT_FONTSUPPORT_DIRECTWRITE true)
#  ELSE(HAVE_PANGO AND NOT "${WT_WRASTERIMAGE_IMPLEMENTATION}" STREQUAL "Direct2D")
#    SET(libsources ${libsources} Wt/FontSupport.h Wt/FontSupportSimple.C)
#    SET(WT_FONTSUPPORT_SIMPLE true)
#  ENDIF(HAVE_PANGO AND NOT "${WT_WRASTERIMAGE_IMPLEMENTATION}" STREQUAL "Direct2D")
#ENDIF(HAVE_HARU OR "${WT_WRASTERIMAGE_IMPLEMENTATION}" STREQUAL "GraphicsMagick" OR "${WT_WRASTERIMAGE_IMPLEMENTATION}" STREQUAL "Direct2D")

SET(libsources ${libsources} Wt/FontSupport.h Wt/FontSupportDirectWrite.C)
SET(WT_FONTSUPPORT_DIRECTWRITE true)

With this Wt 4.3.0 compiles fine using MinGW including WRasterImage-d2d1 and WRasterImage is working in my code.

Actions #4

Updated by Roel Standaert about 4 years ago

Right, so the issue must be that earlier on, CMake does not set HAVE_DIRECTWRITE to true.

Actions #5

Updated by Roel Standaert about 4 years ago

  • Status changed from New to Resolved

Ok, I enabled DirectWrite when using MinGW, and also set Direct2D to be enabled by default. I also changed the libs that we're linking it to lowercase, for cross-compiling from Linux (Linux is case sensitive).

Actions #6

Updated by Roel Standaert almost 4 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF