Opened 6 weeks ago

Closed 6 weeks ago

Last modified 6 weeks ago

#7033 closed defect (fixed)

gdal-2.0.3: poppler-0.58 breaks build

Reported by: wiz Owned by: warmerdam
Priority: high Milestone: 2.2.2
Component: default Version: 2.0.3
Severity: major Keywords:
Cc:

Description

poppler-0.58 changed the API, which breaks the build of the PDF backend of gdal.

In file included from pdfdataset.cpp:40:0:
pdfio.h:78:38: error: conflicting return type specified for 'virtual int VSIPDFFileStream::getPos()'
         virtual getPos_ret_type      getPos();
                                      ^~~~~~
In file included from /usr/include/poppler/Object.h:380:0,
                 from pdfobject.h:43,
                 from gdal_pdf.h:47,
                 from pdfdataset.cpp:30:
/usr/include/poppler/Stream.h:190:19: error:   overriding 'virtual Goffset Stream::getPos()'
   virtual Goffset getPos() = 0;
                   ^~~~~~
In file included from pdfdataset.cpp:40:0:
pdfio.h:79:38: error: conflicting return type specified for 'virtual Guint VSIPDFFileStream::getStart()'
         virtual getStart_ret_type    getStart();
                                      ^~~~~~~~
In file included from /usr/include/poppler/Object.h:380:0,
                 from pdfobject.h:43,
                 from gdal_pdf.h:47,
                 from pdfdataset.cpp:30:
/usr/include/poppler/Stream.h:320:19: error:   overriding 'virtual Goffset BaseStream::getStart()'
   virtual Goffset getStart() = 0;
                   ^~~~~~~~
pdfdataset.cpp: In destructor 'ObjectAutoFree::~ObjectAutoFree()':
pdfdataset.cpp:100:25: error: 'void Object::free()' is private within this context
     ~ObjectAutoFree() { free(); }
                         ^~~~
In file included from pdfobject.h:43:0,
                 from gdal_pdf.h:47,
                 from pdfdataset.cpp:30:
/usr/include/poppler/Object.h:291:8: note: declared private here
   void free();
        ^~~~
pdfdataset.cpp:100:30: error: 'void Object::free()' is private within this context
     ~ObjectAutoFree() { free(); }
                              ^
In file included from pdfobject.h:43:0,
                 from gdal_pdf.h:47,
                 from pdfdataset.cpp:30:
/usr/include/poppler/Object.h:291:8: note: declared private here
   void free();
        ^~~~
pdfdataset.cpp: In member function 'virtual void GDALPDFOutputDev::startPage(int, GfxState*)':
pdfdataset.cpp:152:13: error: no matching function for call to 'GDALPDFOutputDev::startPage(int&, GfxState*&)'
             );
             ^
In file included from pdfobject.h:61:0,
                 from gdal_pdf.h:47,
                 from pdfdataset.cpp:30:
/usr/include/poppler/SplashOutputDev.h:235:8: note: candidate: virtual void SplashOutputDev::startPage(int, GfxState*, XRef*)
   void startPage(int pageNum, GfxState *state, XRef *xref) override;
        ^~~~~~~~~
/usr/include/poppler/SplashOutputDev.h:235:8: note:   candidate expects 3 arguments, 2 provided
pdfdataset.cpp: In member function 'virtual GBool GDALPDFOutputDev::deviceHasTextClip(GfxState*)':
pdfdataset.cpp:196:24: error: 'deviceHasTextClip' is not a member of 'SplashOutputDev'
                 return SplashOutputDev::deviceHasTextClip(state);
                        ^~~~~~~~~~~~~~~
pdfdataset.cpp: In member function 'CPLErr PDFDataset::ReadPixels(int, int, int, int, GSpacing, GSpacing, GSpacing, GByte*)':
pdfdataset.cpp:931:47: error: no matching function for call to 'GDALPDFOutputDev::startDoc(XRef*)'
         poSplashOut->startDoc(poDoc->getXRef());
                                               ^
In file included from pdfobject.h:61:0,
                 from gdal_pdf.h:47,
                 from pdfdataset.cpp:30:
/usr/include/poppler/SplashOutputDev.h:350:8: note: candidate: void SplashOutputDev::startDoc(PDFDoc*)
   void startDoc(PDFDoc *docA);
        ^~~~~~~~
/usr/include/poppler/SplashOutputDev.h:350:8: note:   no known conversion for argument 1 from 'XRef*' to 'PDFDoc*'
pdfdataset.cpp: In member function 'GDALPDFObject* PDFDataset::GetCatalog()':
pdfdataset.cpp:1300:67: error: no matching function for call to 'XRef::getCatalog(ObjectAutoFree*&)'
         poDocPoppler->getXRef()->getCatalog(poCatalogObjectPoppler);
                                                                   ^
In file included from /usr/include/poppler/PDFDoc.h:49:0,
                 from pdfobject.h:56,
                 from gdal_pdf.h:47,
                 from pdfdataset.cpp:30:
/usr/include/poppler/XRef.h:144:10: note: candidate: Object XRef::getCatalog()
   Object getCatalog();
          ^~~~~~~~~~
/usr/include/poppler/XRef.h:144:10: note:   candidate expects 0 arguments, 1 provided
pdfdataset.cpp: In static member function 'static GDALDataset* PDFDataset::Open(GDALOpenInfo*)':
pdfdataset.cpp:2690:45: error: 'setErrorFunction' was not declared in this scope
     setErrorFunction(PDFDatasetErrorFunction);
                                             ^
pdfdataset.cpp:2714:14: error: 'class ObjectAutoFree' has no member named 'initNull'; did you mean 'isNull'?
         oObj.initNull();
              ^~~~~~~~
pdfdataset.cpp:2715:78: error: invalid new-expression of abstract class type 'VSIPDFFileStream'
 oDocPoppler = new PDFDoc(new VSIPDFFileStream(fp, pszFilename, &oObj), NULL, poUserPwd);
                                                                     ^
In file included from pdfdataset.cpp:40:0:
pdfio.h:63:7: note:   because the following virtual functions are pure within 'VSIPDFFileStream':
 class VSIPDFFileStream: public BaseStream
       ^~~~~~~~~~~~~~~~
In file included from /usr/include/poppler/Object.h:380:0,
                 from pdfobject.h:43,
                 from gdal_pdf.h:47,
                 from pdfdataset.cpp:30:
/usr/include/poppler/Stream.h:310:8: note: 	virtual void BaseStream::setPos(Goffset, int)
   void setPos(Goffset pos, int dir = 0) override = 0;
        ^~~~~~
/usr/include/poppler/Stream.h:307:23: note: 	virtual BaseStream* BaseStream::copy()
   virtual BaseStream *copy() = 0;
                       ^~~~
/usr/include/poppler/Stream.h:308:19: note: 	virtual Stream* BaseStream::makeSubStream(Goffset, GBool, Goffset, Object&&)
   virtual Stream *makeSubStream(Goffset start, GBool limited,
                   ^~~~~~~~~~~~~
/usr/include/poppler/Stream.h:321:16: note: 	virtual void BaseStream::moveStart(Goffset)
   virtual void moveStart(Goffset delta) = 0;
                ^~~~~~~~~
pdfdataset.cpp:3351:40: error: no matching function for call to 'PDFDoc::getDocInfo(Object*)'
         poDocPoppler->getDocInfo(&oInfo);
                                        ^
In file included from pdfobject.h:56:0,
                 from gdal_pdf.h:47,
                 from pdfdataset.cpp:30:
/usr/include/poppler/PDFDoc.h:232:10: note: candidate: Object PDFDoc::getDocInfo()
   Object getDocInfo() { return xref->getDocInfo(); }
          ^~~~~~~~~~
/usr/include/poppler/PDFDoc.h:232:10: note:   candidate expects 0 arguments, 1 provided
pdfdataset.cpp:3354:20: error: 'void Object::free()' is private within this context
         oInfo.free();
                    ^
In file included from pdfobject.h:43:0,
                 from gdal_pdf.h:47,
                 from pdfdataset.cpp:30:
/usr/include/poppler/Object.h:291:8: note: declared private here
   void free();
        ^~~~
make[2]: *** [../../GDALmake.opt:581: ../o/pdfdataset.o] Error 1

See https://bugs.gentoo.org/show_bug.cgi?id=629758 for a complete build log.

Change History (3)

comment:1 Changed 6 weeks ago by Even Rouault

Resolution: fixed
Status: newclosed

In 40035:

PDF: add support for Poppler 0.58 (mix of my work and patch by David Tardon, fixes #7033)

comment:2 Changed 6 weeks ago by Even Rouault

In 40036:

PDF: add support for Poppler 0.58 (mix of my work and patch by David Tardon, fixes #7033)

comment:3 Changed 6 weeks ago by Even Rouault

Milestone: 2.0.42.2.2
Note: See TracTickets for help on using tickets.