xaviou wrote:I'm currently trying to build wxPdfDocument (v0.9.3) with wxWidgets-2.9.5 (svn),
Usually I build wxPdfDocument against officially released wxWidgets versions only and test for compatibility and implement fixes if some interface changes occur. wxWidgets SVN is a moving target and I can't spare the time to keep wxPdfDocument in sync with it. Nevertheless I checked the wxWidgets SVN to find out what's causing the problem.
xaviou wrote:and I get errors :
Code: Select all
In constructor 'wxPdfDC::wxPdfDC()':
error: cannot allocate an object of abstract type 'wxPdfDCImpl'
note: because the following virtual functions are pure within 'wxPdfDCImpl':
note: virtual void wxDCImpl::DoDrawLines(int, const wxPoint*, wxCoord, wxCoord)
note: virtual void wxDCImpl::DoDrawPolygon(int, const wxPoint*, wxCoord, wxCoord, wxPolygonFillMode)
In constructor 'wxPdfDC::wxPdfDC(const wxPrintData&)':
error: cannot allocate an object of abstract type 'wxPdfDCImpl'
note: since type 'wxPdfDCImpl' has pure virtual functions
In constructor 'wxPdfDC::wxPdfDC(wxPdfDocument*, double, double)':
error: cannot allocate an object of abstract type 'wxPdfDCImpl'
note: since type 'wxPdfDCImpl' has pure virtual functions
The wxWidgets libs were build with the following parameters :
- Release
- Unicode
- Dynamic
- Multi-Libs
- All other parameters to default
Note that it builds fine with wxWidgets-2.9.4.
Does anyone know if there is something to do to avoid these errors or do I have to wait a wxPdfDoc sources update ?
The methods DoDrawLines and DoDrawPolygon are in fact implemented in wxPdfDC. However, up to and including version 2.9.4 of wxWidgets the signatures of these methods were:
Code: Select all
virtual void DoDrawLines(int n, wxPoint points[],
wxCoord xoffset, wxCoord yoffset);
virtual void DoDrawPolygon(int n, wxPoint points[],
wxCoord xoffset, wxCoord yoffset,
wxPolygonFillMode fillStyle = wxODDEVEN_RULE);
In wxWidgets SVN there occurred a change of the signatures by adding constness to the wxPoint array parameters:
Code: Select all
virtual void DoDrawLines(int n, const wxPoint points[],
wxCoord xoffset, wxCoord yoffset);
virtual void DoDrawPolygon(int n, const wxPoint points[],
wxCoord xoffset, wxCoord yoffset,
wxPolygonFillMode fillStyle = wxODDEVEN_RULE);
To make wxPdfDocument compatible with wxWidgets SVN you would have to change the signatures of the methods in the header and source files of the wxPdfDC implementation (include/wx/pdfdc29.h and src/pdfdc29.inc).
Regards,
Ulrich