Error compiling qpdfview

Asked by LinuxUsr

make[1]: *** [Makefile.pdf-plugin:610: objects-pdf/pdfmodel.o] Error 1
make[1]: Leaving directory '/qpdfview'
make: *** [Makefile:48: sub-pdf-plugin-pro-make_first-ordered] Error 2
make: *** [Makefile:64: sub-pdf-plugin-pro-install_subtargets-ordered] Error 2

Tried with Qt5 and Qt6. Used the following commands:
- lrelease-pro qpdfview.pro
- qmake qpdfview.pro
- make
- make install

Question information

Language:
English Edit question
Status:
Solved
For:
qpdfview Edit question
Assignee:
No assignee Edit question
Solved by:
Adam Reichold
Solved:
Last query:
Last reply:
Revision history for this message
Adam Reichold (adamreichold) said :
#1

Hello LinuxUsr,

the output you posted is sadly not the error itself but only the summary by make that there was an error. To diagnose this, we need earlier parts of the output, presumably the error generated by g++. That said and since it already failed building the PDF plug-in, do you have the development headers for Poppler installed? Depending on your distribution, this is libpoppler-qt5/6-dev or libpoppler-qt5/6-devel.

Regards,
Adam

Revision history for this message
LinuxUsr (linux-usr) said :
#2

Thanks. I checked; I have the development headers installed. Here is the full output of "make".

( test -e Makefile.pdf-plugin || /usr/bin/qmake-qt5 -o Makefile.pdf-plugin /opt/qpdfview/pdf-plugin.pro ) && make -f Makefile.pdf-plugin
make[1]: Entering directory '/opt/qpdfview'
g++ -c -pipe -O2 -Wall -Wextra -D_REENTRANT -fPIC -DHAS_POPPLER_14 -DHAS_POPPLER_18 -DHAS_POPPLER_20 -DHAS_POPPLER_22 -DHAS_POPPLER_24 -DHAS_POPPLER_26 -DHAS_POPPLER_31 -DHAS_POPPLER_35 -DQT_NO_DEBUG -DQT_PLUGIN -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_XML_LIB -DQT_CORE_LIB -I. -I/usr/include/poppler/qt5 -I/usr/include/poppler -I/usr/include/qt5 -I/usr/include/qt5/QtWidgets -I/usr/include/qt5/QtGui -I/usr/include/qt5/QtXml -I/usr/include/qt5/QtCore -Imoc-pdf -I/../lib64/qt5/mkspecs/linux-g++ -o objects-pdf/pdfmodel.o sources/pdfmodel.cpp
In file included from sources/pdfmodel.h:43,
                 from sources/pdfmodel.cpp:24:
sources/model.h:46:22: error: field ‘boundary’ has incomplete type ‘QPainterPath’
   46 | QPainterPath boundary;
      | ^~~~~~~~
In file included from /usr/include/qt5/QtGui/qbrush.h:49,
                 from /usr/include/qt5/QtGui/qpalette.h:46,
                 from /usr/include/qt5/QtWidgets/qwidget.h:48,
                 from /usr/include/qt5/QtWidgets/QWidget:1,
                 from sources/model.h:28,
                 from sources/pdfmodel.h:43,
                 from sources/pdfmodel.cpp:24:
/usr/include/qt5/QtGui/qmatrix.h:54:7: note: forward declaration of ‘class QPainterPath’
   54 | class QPainterPath;
      | ^~~~~~~~~~~~
In file included from /usr/include/poppler/qt5/poppler-qt5.h:51,
                 from sources/pdfmodel.cpp:33:
/usr/include/poppler/qt5/poppler-annotation.h:596:5: warning: ‘template<class T> class QLinkedList’ is deprecated: Use std::list instead [-Wdeprecated-declarations]
  596 | QLinkedList<QPointF> linePoints() const;
      | ^~~~~~~~~~~
In file included from /usr/include/qt5/QtCore/qvarlengtharray.h:43,
                 from /usr/include/qt5/QtCore/qmetatype.h:48,
                 from /usr/include/qt5/QtCore/qobject.h:54,
                 from /usr/include/qt5/QtCore/qcoreapplication.h:46,
                 from /usr/include/qt5/QtCore/QCoreApplication:1,
                 from sources/pdfmodel.h:26,
                 from sources/pdfmodel.cpp:24:
/usr/include/qt5/QtCore/qcontainerfwd.h:51:26: note: declared here
   51 | template <class T> class QLinkedList;
      | ^~~~~~~~~~~
In file included from /usr/include/poppler/qt5/poppler-qt5.h:51,
                 from sources/pdfmodel.cpp:33:
/usr/include/poppler/qt5/poppler-annotation.h:597:30: warning: ‘template<class T> class QLinkedList’ is deprecated: Use std::list instead [-Wdeprecated-declarations]
  597 | void setLinePoints(const QLinkedList<QPointF> &points);
      | ^~~~~~~~~~~
In file included from /usr/include/qt5/QtCore/qvarlengtharray.h:43,
                 from /usr/include/qt5/QtCore/qmetatype.h:48,
                 from /usr/include/qt5/QtCore/qobject.h:54,
                 from /usr/include/qt5/QtCore/qcoreapplication.h:46,
                 from /usr/include/qt5/QtCore/QCoreApplication:1,
                 from sources/pdfmodel.h:26,
                 from sources/pdfmodel.cpp:24:
/usr/include/qt5/QtCore/qcontainerfwd.h:51:26: note: declared here
   51 | template <class T> class QLinkedList;
      | ^~~~~~~~~~~
In file included from /usr/include/poppler/qt5/poppler-qt5.h:51,
                 from sources/pdfmodel.cpp:33:
/usr/include/poppler/qt5/poppler-annotation.h:804:11: warning: ‘template<class T> class QLinkedList’ is deprecated: Use std::list instead [-Wdeprecated-declarations]
  804 | QList<QLinkedList<QPointF>> inkPaths() const;
      | ^~~~~~~~~~~
In file included from /usr/include/qt5/QtCore/qvarlengtharray.h:43,
                 from /usr/include/qt5/QtCore/qmetatype.h:48,
                 from /usr/include/qt5/QtCore/qobject.h:54,
                 from /usr/include/qt5/QtCore/qcoreapplication.h:46,
                 from /usr/include/qt5/QtCore/QCoreApplication:1,
                 from sources/pdfmodel.h:26,
                 from sources/pdfmodel.cpp:24:
/usr/include/qt5/QtCore/qcontainerfwd.h:51:26: note: declared here
   51 | template <class T> class QLinkedList;
      | ^~~~~~~~~~~
In file included from /usr/include/poppler/qt5/poppler-qt5.h:51,
                 from sources/pdfmodel.cpp:33:
/usr/include/poppler/qt5/poppler-annotation.h:805:34: warning: ‘template<class T> class QLinkedList’ is deprecated: Use std::list instead [-Wdeprecated-declarations]
  805 | void setInkPaths(const QList<QLinkedList<QPointF>> &paths);
      | ^~~~~~~~~~~
In file included from /usr/include/qt5/QtCore/qvarlengtharray.h:43,
                 from /usr/include/qt5/QtCore/qmetatype.h:48,
                 from /usr/include/qt5/QtCore/qobject.h:54,
                 from /usr/include/qt5/QtCore/qcoreapplication.h:46,
                 from /usr/include/qt5/QtCore/QCoreApplication:1,
                 from sources/pdfmodel.h:26,
                 from sources/pdfmodel.cpp:24:
/usr/include/qt5/QtCore/qcontainerfwd.h:51:26: note: declared here
   51 | template <class T> class QLinkedList;
      | ^~~~~~~~~~~
sources/pdfmodel.cpp: In member function ‘virtual qpdfview::Model::Outline qpdfview::Model::PdfDocument::outline() const’:
sources/pdfmodel.cpp:979:55: warning: ‘QDomDocument* Poppler::Document::toc() const’ is deprecated [-Wdeprecated-declarations]
  979 | QScopedPointer< QDomDocument > toc(m_document->toc());
      | ~~~~~~~~~~~~~~~^~
In file included from sources/pdfmodel.cpp:33:
/usr/include/poppler/qt5/poppler-qt5.h:1746:37: note: declared here
 1746 | Q_DECL_DEPRECATED QDomDocument *toc() const;
      | ^~~
sources/pdfmodel.cpp: In member function ‘virtual qpdfview::Model::Properties qpdfview::Model::PdfDocument::properties() const’:
sources/pdfmodel.cpp:1009:30: warning: ‘void Poppler::Document::getPdfVersion(int*, int*) const’ is deprecated [-Wdeprecated-declarations]
 1009 | m_document->getPdfVersion(&pdfMajorVersion, &pdfMinorVersion);
      | ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from sources/pdfmodel.cpp:33:
/usr/include/poppler/qt5/poppler-qt5.h:1656:28: note: declared here
 1656 | Q_DECL_DEPRECATED void getPdfVersion(int *major, int *minor) const;
      | ^~~~~~~~~~~~~
make[1]: *** [Makefile.pdf-plugin:610: objects-pdf/pdfmodel.o] Error 1
make[1]: Leaving directory '/opt/qpdfview'
make: *** [Makefile:48: sub-pdf-plugin-pro-make_first-ordered] Error 2

Revision history for this message
Adam Reichold (adamreichold) said :
#3

Hello again,

thanks for the full log. The error

sources/model.h:46:22: error: field ‘boundary’ has incomplete type ‘QPainterPath’

is rather strange as "model.h" does include that "QPainterPath", c.f. https://bazaar.launchpad.net/~adamreichold/qpdfview/trunk/view/head:/sources/model.h#L27

Do you use the current trunk to build it? (I ask because the offending declaration should be at line 47 in that version.) Is the error the same when using Qt version 6?

Regards,
Adam

Revision history for this message
LinuxUsr (linux-usr) said :
#4

Hi... Thanks. This is what I am using https://launchpad.net/qpdfview/trunk/0.4.18/+download/qpdfview-0.4.18.tar.gz, the latest version available at https://launchpad.net/qpdfview.

Revision history for this message
Best Adam Reichold (adamreichold) said :
#5

Yes, that version is a bit long in the tooth by now (I just have not gotten around to making a release yet), please use a snapshot of the current trunk available at https://code.launchpad.net/~adamreichold/qpdfview/trunk It should be pretty stable and in contrast to version 0.4.18, it is compatible with Qt version 6.

Revision history for this message
LinuxUsr (linux-usr) said :
#6

Thanks. It gave the same error. Anyway, we can close the case. It should be a problem with my setup. Thanks much.

Revision history for this message
LinuxUsr (linux-usr) said :
#7

Thanks Adam Reichold, that solved my question.

Revision history for this message
LinuxUsr (linux-usr) said :
#8

Just wanted to add that this worked perfectly now. Sometimes "make clean" is not enough. So, I deleted everything, got a fresh version (the trunk you pointed to), and compiled. Worked perfectly. Looks beautiful. Thanks much.